Resolving invalid byte 3 of 3-byte UTF-8 sequences

The maven project compiles normally, but the following error is reported at runtime: 
Byte 3 of the 3-byte UTF-8 sequence is invalid

Looking closely at the details of this error, you will find that it is a character recognition problem in an xml file. The solution is as follows: 
Add the following to pom.xml

<!-- resource插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin>

The point is the UTF-8 encoding in the configuration above.

After recompiling it works fine.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324884982&siteId=291194637