You want the server to support a full UTF-8 encoded Web app, but always fall back to iso-8859-1.
Configuration is MySQL 5.6, PHP 5.5, and Apache 2.2.
Want to know exactly where to set the code? There is no need to do the configuration list or anything, but also trouble guidance.
Reply content:
You want the server to support a full UTF-8 encoded Web app, but always fall back to iso-8859-1.
Configuration is MySQL 5.6, PHP 5.5, and Apache 2.2.
Want to know exactly where to set the code? There is no need to do the configuration list or anything, but also trouble guidance.
Mysql:
The default configuration can be used without moving, and the default lantin1 encoding supports UTF-8 storage for reading. Mysqldump back up when you pay attention to skip-charset.
Php&apache:
Set the header at the beginning of the script ("Content-type:text/html;charset=utf-8")
or modify the Apache configuration (http.conf) Adddefaultcharset Utf-8
Html:
In the generated HTML page, add the
Tell the browser page to use the encoding so that the text submitted by the browser post will be utf-8.
Last but not least, you have to ensure that your page text itself is utf-8, otherwise the code is GBK, mandatory declaration into Utf-8, the browser display is garbled.
I hope I can help you:)
Mysql:set names UTF8
Php:
Header Content-type:text/html;charset=utf-8
Development coding with UTF8
Apache does not need to be configured