Php,ajax,mysql,latin1 Coding Problems
MySQL default latin1 encoding, read the data with Ajax read garbled, in the server side of the ajax.php, there are two places involved in the code:
A.header (' Content-type:text/xml;charset=utf-8 ');
B. When querying, add mysql_query ("Set names ' UTF8 '");
In addition, the ajax.php itself is utf-8 encoded.
Can query the record, but look at the XML source code, but this is the content:
²èµêxóõý½öåé³öëù
Tried a lot of code conversion, have failed, please help me!!!!!
------Solution--------------------
XML plus UTF8 coding try
------Solution--------------------
MySQL default latin1 encoding change Utf-8
Client HTML with Utf-8
To the time, whether it is shrimp-like, as long as the client can normally display on OK
------Solution--------------------
Multibyte characters do not use LATIN1. Suggest using UTF8 or GBK
------Solution--------------------
Best Unified encoding Format ~ ~
------Solution--------------------
With Iconv () Unified Code No?
------Solution--------------------
B. When querying, add mysql_query ("Set names ' UTF8 '");
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.