Home > Backend Development > PHP Tutorial > Solution to Apache forcing UTF-8 garbled characters in CentOS

Solution to Apache forcing UTF-8 garbled characters in CentOS

WBOY
Release: 2016-07-25 08:51:06
Original
1267 people have browsed it
Solution to Apache forcing UTF-8 garbled characters in CentOS
                 
                                                                                                                                                                                                                                                                                                                  


The Centos system was not used much in the past. Later, the company's servers unified the operating system and all used Centos;
    So, naturally, I used yum to install services, which was very convenient, but the configuration of the services was not It’s very transparent, you need to explore it yourself
  1. Then, I encountered a problem, as follows:
  2. Some of the company’s websites use UTF-8 encoding, and some use GBK. I found that when displayed on the page, The UTF encoding is normal, but the GBK encoding is garbled. At first, I thought it was because the system does not support GBK. After trying it, I found out that there was a problem with a setting of APACHE. After YUM was installed, the default encoding output was: utf -8
  3. And it is still forced to convert and will not change according to the METH set on your website page. This setting is AddDefaultCharset
  4. Method:
  5. AddDefaultCharset UTF-8 is changed to AddDefaultCharset OFF
  6. Result:
  7. Get it Work~ ~
  8. Summary:
  9. In retrospect, this kind of YUM installation is actually very convenient, but the configuration is indeed opaque and there is no documentation. It’s okay if there is no problem. If something goes wrong, it can’t be located quickly!
  10. Copy code
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template