The byte 1 of the 1-byte UTF-8 sequence in XML is not valid ([character encoding]invalid byte 1 of 1-by

Source: Internet
Author: User

When writing a pom.xml file in eclipse today, the Chinese in the note was identified by Eclipse as error: Invalid byte 1 of 1-byte UTF-8 sequence, which has been encountered many times, the root cause of the problem is:

The cause of this is a file which is not UTF-8 is being parsed as UTF-8. It is likely, the parser is encountering a, a byte value in the range FE - FF . These values is invalid in the UTF-8 encoding.

But this is very strange, I use notepad++ to save Pom.xml code as "UTF-8 no BOM" form, Pom.xml file encoding property set to "UTF-8", the problem is still ah, depressed, is there a problem with the above theory? Or the eclipse bug? Read on the internet for a long while, basically say so.

First, you can change UTF-8 to GBK or GB2312 directly in the XML file

<?xml version= "1.0" encoding= "GB2312"?>

Second, it can be changed in Eclipse, in the Eclipse's menu [project]→[properties], click [Resources], on the right side of the "text file encoding", the original is the system preset code, changed to "utf-8".

The first kind of solution is feasible, belongs to the escape method, abandons! The second is not the solution to my problem, continue to search the Internet surprise discovery, the original solution is this:

Change the encoding attribute value of XML UTF-8 to UTF8, I'm so hurt.


The byte 1 of the 1-byte UTF-8 sequence in XML is not valid ([character encoding]invalid byte 1 of 1-by

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.