IE6 cannot actively identify UTF-8 encoding, leading to blank page Problems

Source: Internet
Author: User
Tags script php

This articleArticleSolved my one-night tangle problem !!! Recommended. Sometimes IE8 does the same.

Set joomla! After being modified to UTF-8 encoding, some templates (such as joomla! 1.03 the rhuk_solarflare_ii template) occasionally opens the page blank, especially when the browser is not set to "auto-select" encoding.

When IE6 is used as a browser in windows. This often occurs when browsing a Web page that uses UTF-8 encoding, the browser cannot automatically detect the encoding that the page uses (that is, when the Autoselect encoding format is not set. Even if the webpage has already declared the encoding format:

<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>

This causes some pages containing the Chinese UTF-8 code to generate a blank output.

If you are using IE7/8, Mozilla, Mozilla Firefox, and sarafi browsers, this will not cause this problem. This is because IE6 gives priority to HTML tags when parsing webpage code, and then the messages in HTTP headers. Mozilla browsers are just the opposite.

Since the UTF-8 represents a Chinese character in 3 bytes, the normal gb2312 or big5 is two. When the browser parses and outputs the content of <title> </title> for the preceding reason, if there are odd full-width characters before </title>, IE6 the UTF-8 as two byte parsing when the emergence of half a Chinese character, then the half a Chinese character and </title> <combined into a Garbled word, as a result, IE6 cannot read the <title> part, so that the entire page is empty. At this time, if you look at the source file, you will find that the entire page has actually been output.

Therefore, the simplest solution is to define the character <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8 '/> before <title> </title>.

PS: encoding method

1. The Server httpd. conf file: adddefadefacharset UTF-8
This method is not recommended because websites with other codes may exist on the server, so you can use adddefacharcharset off to disable the default file encoding, the server depends on the language set in the HTML file cast to determine the encoding.

2. Script PHP. ini file: default_charset = "UTF-8 ″
The role is the same as that of the httpd. conf file. It is not recommended. you can comment out this line for the same reason.

3. htaccess documentation: adddefaultcharset UTF-8
Generally, httpd. CNF and PHP. ini cannot be modified, and it is not recommended to modify these two files. You can also write the. htaccess document under the root directory of the website, and set the website character set in this document.

4. webpage file character set:
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>

====================================

This IE6 bug finally met me. Today I am engaged in the outgo (post table) of mya2, And the <title> post table </title> is blank in IE6, the browser is interpreted as GBK. So before <meta UTF-8> mention <title>, OK!

I thought I had already done goodbye to IE6. By chance, I found that I had to perform a full test.

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.