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...