Why garbled: <meta http-equiv= "Content-type" > non-ANSI characters before
Browser detects the default order of page character sets
The browser's page character set detection sequence is usually:
- CharSet parameter in HTTP Content-type header.
- <meta http-equiv= "Content-type" > element in the
- BOM (Byte Order Mark).
- Auto-detect the character encoding as a last resort.
Note one:HTTP content-type Header If CharSet is specified , the priority is higher than the HTML document <meta http-equiv= " Content-type "> in the CharSet declaration .
Note two: If the HTTP Content-type header does not specify CharSet, and the HTML document <meta http-equiv= "Content-type" > preceded by non-ANSI characters, It is possible that this meta tag will not be parsed , and remember that this issue has occurred in Blogger.com in 2005. As shown, it is a good practice to keep this meta tag before the title, but the Chinese note in the Green font will cause some browsers to no longer detect the character set:
Note Three: After the second step, if the character set is not explicitly specified, the browser temporarily takes the default character set. If the default value for the Chinese version of IE is Gb2312,firefox, the default value for the Chinese version is GBK.
Some browsers (such as the IE kernel version of the browser) due to Meta before the Chinese cause unresolved, will use the default character set GB2312 to parse the page , So what you see after the rendering is this garbled:
That is, when you can see clearly garbled Chinese characters or characters arrangement, probably is the browser UTF-8 document as GB2312 parsing.
Why garbled: <meta http-equiv= "Content-type" > non-ANSI characters before