ml 3 字节的 UTF-8 序列的字节 3 无效

来源:互联网 发布:mac版finale怎么激活 编辑:程序博客网 时间:2024/06/16 07:15

今天在eclipse中编写**.xml文件时,注释中的中文被eclipse识别到错误:3 字节的 UTF-8 序列的字节 3 无效,曾多次遇到该问题,问题的根源是:

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

但这次很诡异,我使用notepad++将pom.xml的编码保存为“UTF-8无BOM”形式,pom.xml文件内的encoding属性设置为“UTF-8”,问题依旧啊,郁闷了,难道上述的理论有问题?还是eclipse的bug呢?在网上看了半天,基本都是这么说的。

第一,可以直接在XML文件中更改UTF-8为GBK或GB2312

<properties> <project.build.sourceEncoding>UTF8</project.build.sourceEncoding></properties>
0 0
原创粉丝点击