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