Browse UTF-8 encoded Web page with blank workaround _php Tutorial

Source: Internet
Author: User

One aspect is server resolution:

Apache Settings: Adddefaultcharset UTF-8

Another aspect of the following events, I have also encountered:

UTF-8 Web page, let others to visit, results many people say into a blank after the discovery is because the browser does not automatically choose to UTF-8 text encoding.

When using IE as a browser on the Windows operating system. This often happens when browsing a webpage that uses UTF-8 encoding, the browser does not automatically detect (that is, the encoding used for the page is not set when the "Auto-select" encoding format is used). Even if the page has already been declared encoded in the format:

CODE:

This results in some pages containing Chinese UTF-8 encoding to produce blank output.

If you are using Mozilla, Mozilla Firefox, Sarafi Browser This will not cause this problem. This is because IE parsing the page encoding when the HTML tag first, and then the HTTP header message, and the Mozilla series of browsers is just the opposite.

Since UTF-8 represents a Chinese character for 3 bytes, the normal GB2312 or BIG5 is two. Page output, because of the above reasons, so that the browser parsing, output content, if there is an odd number of full-width characters before, ie put UTF-8 as two bytes parsing occurs when half of the Chinese characters, then the half of the characters will and<>< p=""> <>

http://www.bkjia.com/PHPjc/531657.html www.bkjia.com true http://www.bkjia.com/PHPjc/531657.html techarticle One aspect is the server solution: Apache settings: Adddefaultcharset UTF-8 Another aspect of the following events, I have also encountered: UTF-8 Web page, let others to visit, results 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.