今天在eclipse中编写pom.xml文件时,注释中的中文被eclipse识别到错误:Invalid byte 1 of 1-byte UTF-8 sequence,曾多次遇到该问题,问题的根源是:
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
<?xml version="1.0" encoding="GB2312"?>
第二,可以在Eclipse中更改,在 eclipse 的功能表 [Project]→[Properties],點選 [Resources],在右邊的「Text file encoding」,把原來是系統預設的編碼,改為 「UTF-8」。
第一种方案可行,属于逃避的方法,放弃!第二种也不是解决我这种问题的,继续网上搜索惊奇的发现,原来解决方案是这样的:
把xml的encoding属性值UTF-8改为UTF8,我操,太伤蛋了
相关推荐
解决Invalid byte 1 of 1-byte UTF-8 sequence
在利用php解析xml时提示Invalid byte 1 of 1-byte UTF-8 sequence错误了,这个问题我百度查实说是编码问题,结果我把编码处理一下果然KO了,下面我来分享一下解决办法
invalid multibyte character sequence 870告警1
dorado4.jar 下载 超炫的UI效果 使用方法,应用实例,操作说明。。。。
包括ruby用户指南,RGSS入门教程,Programming Ruby,Ruby参考手册共4部分内容。 chm格式
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 2: invalid continuation byte-附件资源
org.xmlpull.v1.XmlPullParserException: PI must not start with xml (position:unknown @1:5 in java.io.InputStreamReader@47ec2770) org.xml.sax.SAXParseException: PI must not start with xml ...
使用dorado基础技术进行Web应用开发
最近对SQL Server到PostgreSQL的数据迁移时出现了问题,返回的错误为:invalid byte sequence for encoding "UTF8": 0x00。经查证pg源代码,该问题引起的原因是sql server的字符类型字段中含有空字符0,该字符在pg中...
设计思路: 在lastWindow上添加一个等宽等高的子视图,在此视图上进行布局。 YSEvaluateControl文件夹:就是控件所在文件玩意儿,...1、创建控件 2、添加valueChanged事件,参考ViewController代码,非常简单。
最新Python学习笔记,Day 1,总结性学习笔记,适合初学者归纳总结。
错误样式:’utf8′ codec can’t decode byte 0xc0 in position 0: invalid start byte,如下图: 错误原因:报这个错误提示的意思我理解的是存在中文无法解读,因为我没有输入中文,所有推测可能是当前用户的user...
syntax: valid, invalid_pos = utf8.validate(str) 精氨酸: str :字符串返回值: valid (布尔值)输入的字符串是否为有效的utf8字符串。 给定字符串中第一个无效字节的invalid_pos (数字)位置。伦获取给定的...
myelicpse 出现Invalid location of tag的问题解决方法
by-octet string comparison of an octet sequence would produce the same result if a naive octet-by-octet string comparison were done on the UTF-8 encoding of the octet sequence. This is also true of ...
离线安装包,亲测可用
config.sub Invalid configuration `xxx': machine/OS `XXX' not recognized问题解决
Bad character in paramenters ------------------参数中有不适当的字符 Bad file name format in include directive --------------------包含命令中文件名格式不正确 Bad ifdef directive synatax -------------...