Apache garbled characters in Chinese

Source: Internet
Author: User

When you use Apache 2.2 to publish an html webpage, you can see that all Chinese characters on the webpage are garbled.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/012403F46-0.png "title =" QQ20130604164942.png "/>

Previously, it was normal to publish the display on IIS, And the webpage encoding should be okay. Check the source code to confirm that the html document is encoded as GB2312.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/012403C94-1.png "title =" QQ20130604164355.png "/>

Find the AddDefaultCharset field in the/etc/httpd/conf/httpd. conf file and find that the default configuration is: UTF-8

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/01240339A-2.png "title =" QQ20130604164211.png "/>

Change the UTF-8 to: GBK or GB2312 restart httpd service, Chinese display normal

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/0124032X6-3.png "style =" float: none; "title =" QQ20130604164122.png "/>

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/0124033343-4.png "style =" float: none; "title =" QQ20130604164149.png "/>

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/01240324A-5.png "title =" QQ20130604164004.png "style =" float: none; "/>

Others said on the internet, changing the UTF-8 to GBK/GB2312 can indeed make the Chinese display, but the UTF-8 code file will be garbled. Set adddefacharcharset to OFF and restart the httpd service to display the code in the source code of the webpage.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/01240312K-6.png "title =" 3.png"/>


Reference: http://jdkcn.com/entry/Apache_AddDefaultCharset_problem.html


This article from the "small white big violent" blog, please be sure to keep this source http://kindit.blog.51cto.com/2286921/1216057

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.