The default php encoding is commented out, and the default apache encoding is also changed. However, when the website is opened, it is still garbled? What is the reason? If you add a phpheader to the interface, the browser will be able to access it normally, but the program is an old program written by the predecessors and does not even have a unified portal, the actual environment for changing each file is php... the default php encoding is commented out, and the default apache encoding is also changed. However, when the website is opened, it is still garbled? Why?
If php header is added to the interface, the browser can access the interface normally, but the program is an old program written by the predecessors, and there is no unified entrance. It is unrealistic to change each file.
The environment is php5.6 and centos6.5.
There is no problem with the program on another server, and the windows local environment is okay.
Reply content:
The default php encoding is commented out, and the default apache encoding is also changed. However, when the website is opened, it is still garbled? Why?
If php header is added to the interface, the browser can access the interface normally, but the program is an old program written by the predecessors, and there is no unified entrance. It is unrealistic to change each file.
The environment is php5.6 and centos6.5.
There is no problem with the program on another server, and the windows local environment is okay.
After setting charset for meta, you also need to change the file encoding to ansi. Many file encoding tools are supported by general editors. I use Editplus, and there is a "file encoding" under the "document" menu, which can be modified. If charset = UTF-8, the file encoding is also UTF-8. The browser reads the file encoding by default, and the meta setting is generally not a priority.
Shouldn't html be set to UTF-8 ??
Not meta?
What is the browser code? Now the default browser is estimated to be UTF-8.
For example, when I write a new webpage encoded as gbk, It is garbled to open it in a browser, and chrome and Firefox are garbled.
In Chrome or ff f12, check whether content-type in the response header contains the character set you need. If not, check whether apache settings are appropriate.