UTF-8 cannot automatically select character encoding (IFRAME), page output Blank

Source: Internet
Author: User

When debugging the page, my colleagues found that if IE does not select automatic encoding, some UTF-8 pages will be blank in IE, even if you habitually Add: <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>

Cause:

UTF-8 represents a Chinese character in three bytes, while the common gb2312 or big5 represents two. It happens that IE takes the priority of HTML tags when parsing webpage encoding, and then parses the content in the header, but ff and other browsers are the opposite. Because of this, when the title contains an odd number of full-width characters, IE treats UTF-8 as two bytes for parsing and half a Chinese character, at this time, the half Chinese character will be combined with </title> <into a garbled text, resulting in IE being unable to read the <title> part, making the entire page blank.

Solution:

In fact, it is very simple to put <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/> in front of <title> </title>.

How do they:

Google:

<Meta http-equiv = Content-Type content = "text/html; charset = UTF-8">
<Title> Chinese-Google search </title>

Yahoo:

<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Title> here is the Chinese _ Yahoo Web Search </title>

From: http://blog.52news.com/article.asp? Id = 1481

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.