The header is already set to Utf-8 on all pages. Garbled results in no way and data in the row comparison, and the original text is not equal.
Reply content:
The header is already set to Utf-8 on all pages. Garbled results in no way and data in the row comparison, and the original text is not equal.
Find the reason, because the write database is processed with the function mysql_real_escape (), and the removal does not reverse processing results in Chinese garbled, using stripslashes () processing after reading normal.
First you should look at the file encoding, if the file encoding is Gbk,header also wood, the header just tells the client the following content in accordance with UTF8 parsing, and the file or the content itself encoding regardless, as to the database will not garbled, this is related to the character set range, Database will be garbled can give an example: if the file is GBK encoding, database field is UTF8, stored when set names UTF8, read out in UTF8 file display when set CharSet is UTF8, my understanding is not garbled, Because the GBK character set range is smaller than UTF8, GBK content to UTF8 encoding can be stored under, and UTF8 storage and UTF8 display is not garbled, if the GBK read out I think it will be garbled, although the file is GBK, but it is stored in the database UTF8, And UTF8 is accounted for three bytes or more, and GBK is two bytes, so GBK can not show UTF8 content, so will garbled, on paper, no practice, in this fallacy, I just said I am so understanding!