Blank during webpage UTF8 encoding development

Source: Internet
Author: User
Tags ultraedit
A problem that cannot be solved during development is that the page uses UTF8 encoding, and the template containing files is used for the header and tail. as a result, each of the headers and tails has an extra 10 px blank line, nothing. The reason is that all uses utf8 encoding, including files, the final binary stream contains multiple UTF8BOM tags, IE cannot be resolved normally contains multiple "> <LINKhref =" http://www.ph

A problem that 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: \ xEF \ xBB \ xBF, PHP4, and 5 are still ignored. Therefore, the BOM is output directly before resolution.
In this regard, the w3.org standard FAQ has a special description on this issue: the encoding contains a character called "zero width no-break space", which is encoded as 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 an operating system that uses BOM to mark the encoding method of text files: WindowsXP Professional, default character set: Chinese 1) notepad: automatically identifies UTF-8 encoded files without bom, however, you cannot control whether to add a bom when saving the file. if you save the file, the bom is 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.3) UltraEdit: the most powerful character encoding function is that it can automatically identify UTF-8 files with and without bom (which can be configured). you can select whether to add bom when saving the file. (Note that when saving a new file, you need to save it as UTF-8 no bom.) later, we found that Notepad ++ also provides better support for UTF-8 bom. we recommend that you use it.

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.