Blank issues during webpage UTF8 encoding development _ PHP Tutorial

Source: Internet
Author: User
Tags ultraedit
The problem of blank space in webpage UTF8 encoding development. A problem that cannot be solved during development is that the page uses UTF8 encoding and the template file inclusion method is used in the header and tail, as a result, there is an extra 10px blank row in the header and tail, which cannot be solved during development.
The page is UTF-8 encoded, and the template containing files is used in the header and tail. as a result, each header and tail have a blank line of about 10 PX, and there is nothing.
The reason is that all files are UTF-8 encoded. when files are included, the final binary stream contains multiple utf8 BOM tags. IE cannot parse pages containing multiple UTF8 BOM tags normally, directly replace it with the actual displayed carriage return, which leads to a blank line, but firefox does not.
Therefore, if the template contains multiple utf8 files, use the ultraedit save as function to select utf8 without bom format.
In addition, if the Chinese page places the title tag in the html head tag The page is blank.
Therefore, standard order should be used for utf8 pages










BOM header: xEFxBBxBF, PHP4, and 5 are still ignored. Therefore, the BOM is output directly before resolution.
This w3.org standard FAQ provides a special description of this issue:

Http://www.w3.org/International/questions/qa-utf8-bom

The details are as follows:

There is a character named "zero width no-break space" in the UCS encoding, and its encoding is FEFF. FFFE does not exist in the UCS, so it should not appear in actual transmission. We recommend that you first transmit the character "zero width no-break space" before transmitting the byte stream ". In this way, if the receiver receives FEFF, it indicates that the byte stream is Big-Endian; if it receives FFFE, it indicates that the byte stream is Little-Endian. Therefore, the character "zero width no-break space" is also called BOM.

The UTF-8 does not need BOM to indicate the byte order, but BOM can be used to indicate the encoding method. The UTF-8 code for the character "zero width no-break space" is ef bb bf. So if the receiver receives a byte stream starting with ef bb bf, it will know that this is UTF-8 encoding.

Windows is the operating system that uses BOM to mark the encoding method of text files: WindowsXP Professional, default character set: Chinese

1) notepad: it can automatically identify UTF-8 encoded files without bom, but it cannot control whether to add bom when saving the file. if the file is saved, the bom will be added in a unified manner.

2) editplus: can not automatically identify the UTF-8 encoding format file without bom, when saving the file, select the UTF-8 format, will not write BOM header in the file header.

3) UltraEdit: it is the most powerful character encoding function. it can automatically identify the UTF-8 files with and without bom (which can be configured). During saving, you can select whether to add bom through configuration.

(Note that when saving a new file, you must save it as UTF-8 no bom)

Later, we found that Notepad ++ also provides better support for the UTF-8 bom. we recommend that you use it.

The upload page is UTF-8 encoded. the template containing files is used for the header and tail. as a result, each header and tail have an empty line of about 10 px...

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.