Thinkphp3.1 put it on IIS and garbled characters appear. apache is normal. what is the problem? Thinkphp3.1 put it on IIS and garbled characters appear. apache is normal. what is the problem? Don't say the encoding problem, I checked the database and configuration file, are UTF-8, and the generated cache file is normal, is also the UTF-8
Reply to discussion (solution)
The default character set of thinkphp is UTF-8.
However, none of the headers in his code ("Content-Type: text/html; charset = utf-8 ");
In this way, problems may occur when running IIS. By default, IIS sends a System character set header. for simplified Chinese systems, Content-Type: text/html; charset = gb2312
So garbled code is generated.
When running the program, declare the header encoding or change the browser encoding.
It must be about encoding, not about encoding.
It is not about file encoding, but about output encoding.