i just want to know about the language transation for the Japanese, 1) Which is the best encoding for the database mysql 2) Which/how can i print that in HTML page. ? thanks in advance.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Update... This Q&A suggests that
CHARACTER SET utf8mb4 COLLATION utf8mb4_unicode_520_ci
is best in newer versions of MySQL.Make Sure
When everything is talking the encoding you can live happily :)
For MySQL: utf8 charset, utf8_general_ci collation For PHP headers:
For HTML
I'd definitely refer to the now-somewhat-canonical PHP UTF-8 Cheatsheet
UTF-8 without a doubt. Make everything UTF-8. To put UTF-8 encoded text on your web page, use this within your HEAD tag:
As for MySQL, put the following into your my.cnf (config) file:
If you're getting garbage characters from the database from queries executed by your application, you might need to execute these two queries before fetching your Japanese text: