Web page with the title of Chinese UTF-8 encoded in IE will display a blank page

Source: Internet
Author: User
Tags blank page

Reason: This is because IE parsing the page encoding when the HTML tag first, and then the HTTP header message, and the Mozilla series of browsers is just the opposite. Since UTF-8 represents a man for 3 bytes, the normal GB2312 or BIG5 is two. When the page output, because of the above reasons, so that the browser parsing, output <title></title> content, if there is an odd number of full-width characters before </title>, ie treats UTF-8 as a two byte parsing when half of the Chinese characters appear, At this time the half of the Chinese character and </title> < combined into a garbled character, resulting in IE can not read the <title> part, so that the entire page is empty hundred output. This time, if you look at the source file, you will find that the entire leaf has actually been output.

Workaround: <meta charset= "UTF-8" > before <title></title>

Made a small test using the Windows SP4 operating system, IE6 SP1 and Firefox 1.5.0.5 browser. All files use the DOS format line break. The test code is as follows:
<?php header ("content-type:text/html; Charset=utf-8″)?>

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.