Problem with BOM Header

Source: Internet
Author: User

Problem with BOM Header

The problem occurs when JAXB transforms an XML file into a Java object, and a modified XML file with UE is added to the BOM header, resulting in problems with parsing. However, log4j parsing an XML file with a BOM header will not be problematic.

What is a BOM header?
In the Utf-8 encoded file, the BOM is in the file header, occupies three bytes, which is used to indicate that the file belongs to Utf-8 encoding.
Now there are many software to identify the BOM header, but also some do not recognize the BOM header, such as PHP does not recognize the BOM header, which is the use of Notepad editing Utf-8 code execution will be the cause of the error.

The way to get rid of BOM head, simple is the following two kinds:
1, EditPlus to the BOM head method
After the editor is resized to UTF8 encoded format, the saved file will be preceded by a string of hidden characters (also known as BOMs), used by the editor to identify whether the file is encoded in UTF8.
Run EditPlus, click Tools, select Preferences, select File, UTF-8 identity Select Always delete signature,
2, UltraEdit removal of BOM head method
After opening the file, Save As option in the encoding format selected (Utf-8 without BOM header), OK.

The BOM is only available when the "notepad" store is stored as UTF-8 in Windows, which can be deleted with the Winhex of the first 2 bytes.

Problem with BOM Header

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.