Thinkphp3.1 put it on IIS and garbled characters appear. apache is normal. what is the problem?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.