Blank workaround for browsing UTF-8 encoded pages

Source: Internet
Author: User
Tags format

One aspect is server resolution:

Apache Settings: Adddefaultcharset UTF-8

Another aspect of the following events, I have also encountered:

UTF-8 's Web page, let others to visit, the results of many people said to enter a blank after the discovery is because the browser did not automatically select to UTF-8 text encoding.

When using IE as a browser on the Windows operating system. The problem often occurs when browsing a Web page that uses UTF-8 encoding, which is not automatically detected by the browser (that is, when the Automatically select encoding format is not set) the encoding used for the page. Even if the page has been declared in the encoding format:

This causes some pages containing Chinese UTF-8 encoding to produce blank output.

If you're using Mozilla, Mozilla Firefox, and Sarafi browsers, that's not going to be the problem. This is because IE parsing the page encoding in HTML is preferred, then the HTTP header message, and the Mozilla series browser is just the opposite.

Since UTF-8 represents a Chinese character for 3 bytes, the average GB2312 or BIG5 is two. Page output, because of the above reasons, so that the browser parsing, output of the content, if there is an odd number of full-width characters, ie UTF-8 as two byte parsing when half of Chinese characters, then the half of the Chinese characters will be combined with the < into a garbled word, leading to IE can not read the end.



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.