Incorrect IE7 encoding Parsing leads to page conversion to Whiteboard

Source: Internet
Author: User

Operating System: Windows XP SP3

Symptom: the page is blank.

Cause: Incorrect HTML character encoding

Test reproduction:

IE6/8 has no problems and is monopolized by IE7:

<HTML> <br/> <pead> <br/> <title> source </title> <br/> <meta http-equiv = "Content-Type" content =" text/html; charset = UTF-8 "/> <br/> </pead> <br/> <body> if you cannot see this text, note: IE7 does not parse the HTML character encoding correctly </body> <br/> </ptml>

The solution is also very simple. Set the <meta> label of the character set to the front, or add a space at the end of the title text:

<HTML> <br/> <pead> <br/> <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8 "/> <br/> <title> source </title> <br/> </pead> <br/> <body> if you cannot see this text, note: IE7 does not parse the HTML character encoding correctly </body> <br/> </ptml>

You can see that IE7 incorrectly identifies character encoding by default:

PS: when saving the test HTML, select the UTF-8 file encoding, be sure not to save the BOM, otherwise IE7 will not appear this bug. Windows notepad cannot control whether to save Bom. Other text editors such as editplus can be used.

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.