Unicode signature in PHP _ PHP Tutorial

Source: Internet
Author: User
Unicode signature in PHP. The weird code of the WordPress template left blank for half a day. Driven by Dansion's senior brother, we started our Dreamweaver journey. However, few people have noticed that in Dreamweaver, UTF-8 encoding is used by the weird code blank lines of WordPress templates for half a day.

Driven by Dansion's senior brother, we started our Dreamweaver journey. However, few people have noticed that when using UTF-8 encoding to save data in Dreamweaver, the "Unicode standardized form" and "including Unicode signature (BOM)" options are available by default, in the page properties, you can also see:

If the "include Unicode signature" option is selected, page rendering will be odd.

What is a Unicode signature (BOM )?

BOM (Byte Order Mark) is the standard Mark used to identify the encoding in the UTF encoding scheme. 2 to 4 bytes at the beginning of a text file. the file can be identified as Unicode and the byte sequence of the subsequent bytes. Because the UTF-8 does not have a byte order, you can choose to add a UTF-8 BOM. This is required for UTF-16 and UTF-32.

Due to the existence of this BOM, PHP will mistakenly believe that the text content has been output, which will affect page rendering. It is said that PHP6 has fixed this problem.

How can we prevent the impact of Unicode signatures (BOM) on page rendering?

Taking Dreamweaver as an example, if you do not select the "include Unicode signature (BOM)" option when saving UTF-8 encoded documents.

The weird code of the WordPress template is empty for half a day. Driven by Dansion's senior brother, we started our Dreamweaver journey. But few people have noticed that UTF-8 encoding is used in Dreamweaver...

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.