Browse UTF-8 code Web page appears blank solution _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Browse the UTF-8 code page with a blank solution. One aspect is the server solution: Apache settings: AddDefaultCharsetUTF-8 another aspect see the following event, I also encountered: UTF-8 web page, let others to access, the results of many people one aspect is the server solution:

Apache settings: adddefacharcharset UTF-8

In addition, I have encountered the following events:

UTF-8 web page, let others to access, results many people said after entering a blank, found that because the browser did not automatically choose to UTF-8 text encoding.

When IE is used as a browser on windows operating systems. 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 "auto select" encoding format is not set. Even if the webpage has already declared the encoding format:

CODE:

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

If you are using Mozilla, Mozilla Firefox, and Sarafi browsers, this will not cause this problem. This is because IE 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 content for the preceding reason, if there are odd full-width characters in front of the page output, IE treats the UTF-8 as a two-byte parsing when there is a half Chinese character, then the half Chinese character will <结合成一个乱码字,导致ie无法读完之前。< p>

Apache settings: adddefacharcharset UTF-8 another aspect see the following event, I also encountered: UTF-8 web page, let others to access, the results of many people...

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.