Windows utf8 signature is a very difficult issue (the classic Garbled text "escape)

Source: Internet
Author: User

Sometimes you can use a software to save XML and find Chinese garbled characters, which can be opened normally in txt, VS,ProgramOr the third database is opened with XML parsing errors or Chinese garbled characters.

Microsoft added ef bb bf three bytes before its own text file in UTF-8 format

This is definitely a problem.

Two cases are involved: 1. If the user does not have a signature, the user can save the notepad as a new one.

2. If there is a change in signature or no signature, you are too lazy to find it. The following solutions are available:

The following is a reference:

I have looked at the basic Ajax knowledge over the past few days. When I practice a simple request and response, the data returned by PHP always displays the word "response" in IE! Internet Baidu a moment, found that this is because of the system processing UTF-8 method is different and caused.

A flag is automatically added at the beginning of the UTF-8 data returned by PHP, which is an identifier for the UTF-8. For JavaScript, it does not care about this identifier and is still read as data. Therefore, this classic "escape" garbled code will appear.

Solution: copy the relevant file source code to Dreamweaver and save it.

If you use the UTF-8 format that Windows notepad saves. Use the ultraedit Editor, open advanced> Configuration> Unicode/UTF-8 detection, the automatic detection of UTF-8 files, automatic detection of Unicode files without Bom, such as the Front check all removed, then you open the file and you will find that the character "success" appears.

 
Use encoding. utf8 to automatically include a three-byte Bom. If you do not want to add a Bom. Utf8encoding utf8 = new utf8encoding should be used instead (whether to add BOM );

Related Article

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.