Ideally, the three codes are unified into GBK or utf-8, so the parsing is normal. But how can it not be unified? For example:--php encoding is UTF-8--MYSQL encoding is utf-8--browser encoding is GBK at this time, just consider PHP and browse ...
Ideally, the three codes are unified into GBK or utf-8, so the parsing is normal. But how can it not be unified?
Like what:
--php's code is utf-8.
--mysql's code is utf-8.
--The browser encoding is GBK
At this point, just consider PHP and the browser can, because PHP and MySQL encoding is consistent, can not be considered. And how to tell the browser, PHP back to the browser is something to use utf-8, please use utf-8 parsing?
Answer:
(1) One of the methods is the header function we used in PHP. Header ("Content-type:text/html;charset=utf-8");
(2) The second method is that we set it in the META tag of the HTML code.
And if the code between PHP and MySQL is not uniform, how to tell each other's own code?
Answer:
(1) One of the methods is to modify the MySQL server in MySQL to accept PHP and return to PHP data encoding, set Character_set_client=utf8; is to tell the MySQL server current PHP sent by the UTF8 encoding. Set Character_set_result=utf8; is to tell the MySQL server that PHP can only accept utf8 things.
(2) The second method is a simplification of the wording. is to set names UTF8 directly in the PHP code, which means that I only send and receive UTF8 encoded things in PHP. is the simplification of method one above.
After the cities after the start prev up 1.85% gem rise 3.67%:http://licai.daiyuline.com/caijingxinwen/337.html
Hot money can quickly return a A-share key depends on a little "octopus investment Banking": http://licai.daiyuline.com/caijingxinwen/336.html
How to ensure normal parsing when PHP, MySQL, browser code is not unified