UTF-8 encoding, with BOM headers affecting the pattern and garbled characters removed

Source: Internet
Author: User
UTF-8 encoding. the layout is affected by BOM headers, and garbled characters are removed! Rt, html/php/mysql are encoded with UTF-8 in a unified manner. If php uses the BOM encoding format, the page layout will be affected. If include exists in php, a blank line will be displayed on the page; if no BOM encoding is available, all Chinese characters will be garbled. If no BOM encoding is available, the header ("Content-type: & n UTF-8 encoding) will affect the layout and garbled characters!
Rt, html/php/mysql are encoded with UTF-8 in a unified manner. If php uses the BOM encoding format, the page layout will be affected. If include exists in php, a blank line will be displayed on the page; if no BOM encoding is available, all Chinese characters will be garbled. If no BOM encoding is available, adding the header ("Content-type: text/html; charset = utf-8") will still affect the layout, it seems that this code is the function of adding the BOM header.
I don't want to add the include field to all files, so code redundancy occurs.
Is there any good solution? Encoding layout garbled UTF-8 php shared:
------ Solution --------------------
Soy sauce ....
------ Solution --------------------
Reference:
Quote: reference:

Soy sauce ....
I have fixed it...
Set
   
Put it in the first line of each file.


--The garbled text means that the browser cannot identify your encoding format. This should have been added.
------ Solution --------------------
So close the post.

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.