Sometimes MYSQL into phpmyadmin is displayed correctly
Then go to the page there is garbled
It should be a coding error caused the connection set
Use the following settings to correct
mysql_query("SET character_set_client='utf8'"); //MYSQL pass code pages end mysql_query("SET character_set_connection='utf8'"); //MYSQL DB's Coding mysql_query("SET character_set_results='utf8'"); //MYSQL Message encoding (typically a web page end code)
Therefore, there is a case
My page is BIG5 but DB is UTF8
It should be used
mysql_query("SET character_set_client='big5'"); //MYSQL pass code pages end mysql_query("SET character_set_connection='utf8'"); //MYSQL DB's Coding mysql_query("SET character_set_results='big5'"); //MYSQL Message encoding (typically a web page end code)
But if it is on the page is UTF8 but DB is BIG5
mysql_query("SET character_set_client='utf8'"); //MYSQL pass code pages end mysql_query("SET character_set_connection='big5'"); //MYSQL DB's Coding mysql_query("SET character_set_results='utf8'"); //MYSQL Message encoding (typically a web page end code)
To you to be a reference
However, the proposed
Do not use DB for encoding BIG5
Because the garbage problem will make people very, very big head
This is why prefer to use the default encoding latin1_bin not use BIG5
Because even with BIG5 in BIG5 page
The same will produce a lot of garbage
And this distortion can not be converted back
It is proposed
Even BIG5 page
Should also use UTF8 encoding DB
Here for your reference
Message Board
Feel free to leave suggestions and share! Thanksgiving!