I test myself, many characters become '? '。
The database connection is already using the UTF8 character set:
Copy Code code as follows:
Define ("Mysql_encode", "UTF8");
mysql_query (' SET NAMES '. Mysql_encode, $conn) or Die (' character set error '. Mysql_error ());
For half an hour, I didn't get it.
Insert the data are still garbled, suddenly think, is not the field can not save these Vietnamese text.
I look at the database character set, the default is GBK, this to Chinese is no problem, a touch of Vietnamese text, it is garbled.
As a result, I modified the character set of the field that might be used in Vietnamese to UTF8, and proofread it to: Utf8_unicode_ci. (Here must specifically modify a field, modify the entire table's character set, does not work, the field or retain the original character set) problem solved.
My database is: Php_college_web
Table: City_article
Fields used in Vietnamese: Title,content
It then executes the following SQL:
Copy Code code as follows:
ALTER TABLE city_article Change title title VARCHAR (MB) CHARACTER SET UTF8 COLLATE utf8_unicode_ci
ALTER TABLE city_article Change content content text CHARACTER SET UTF8 COLLATE utf8_unicode_ci