用UE编辑的XML为“UTF-8”编码,解析的时候(xercesImpl.jar 版本2.9)抛出org.xml.sax.SAXParseException:Content is not allowed in prolog异常.
google结果为BOM问题,即UE自动增加BOM头,
Unicode规范中有一个BOM的概念。BOM——Byte Order Mark,就是字节序标记。在这里找到一段关于BOM的说明:
在UCS 编码中有一个叫做"ZERO WIDTH NO-BREAK SPACE"的字符,它的编码是FEFF。而FFFE在UCS中是不存在的字符,所以不应该出现在实际传输中。UCS规范建议我们在传输字节流前,先传输字符"ZERO WIDTH NO-BREAK SPACE"。这样如果接收者收到FEFF,就表明这个字节流是Big-Endian的;如果收到FFFE,就表明这个字节流是Little-Endian的。因此字符"ZERO WIDTH NO-BREAK SPACE"又被称作BOM。
UTF-8不需要BOM来表明字节顺序,但可以用BOM来表明编码方式。字符"ZERO WIDTH NO-BREAK SPACE"的UTF-8编码是EF BB BF。所以如果接收者收到以EF BB BF开头的字节流,就知道这是UTF-8编码了。
Windows就是使用BOM来标记文本文件的编码方式的。
UE新版有另存UTF-8 无BOM选项,另存后果然可以。看来还是有大量的东东没有统一标准啊!
分享到:
相关推荐
错误提示Invalid byte 1 of 1-byte UTF-8 sequence原因分析在中文版的window下java...把xml的encoding属性值UTF-8改为UTF8org.xml.sax.SAXParseException: Content is not allowed in trailing section把先要解析和字符
设置隐试打开PPT报错 Hiding the application window is not allowed
从3GPP协议和UE端行为分析5G gmm cause #27的网络问题
directories that will not be allowed to be processed by Diskeeper. Event Logging ------------- Diskeeper records information about its activity in two ways. First, general information about ...
Host 主机名 is not allowed to connect the mysql server 原因:没有授权远程访问mysql 解决方法: cmd 中运行mysql -u root -p(如果报mysql 不是内部或外部命令,找到安装mysql对应的bin文件夹运行mysql.exe,...
NR5G网络拒绝码-5gmm_cause = 7 (0x7) (5GS Service not allowed)
主要介绍了php采用curl访问域名返回405 method not allowed提示的解决方法,需要的朋友可以参考下
nginx: [emerg] “proxy_cache_path” directive is not allowed here in /etc/nginx/conf.d/default.conf:29 提示意思“proxy_cache_path指令不被允许”,在官网上查找了相关说明,也没有发现问题,最后看应用范围...
解决web.xml中 <page-encoding>UTF-8</page-encoding>报错。错误提示: cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. One of '{"http:// java.sun....
"Host 'localhost' is not allowed to connect to this MySQL server" 的原因及解决办法
8 is up, 2 is down, 4 is left, 6 is right. You can also zoom in & out by pressing - and + (NumKeys). This viewer probably will be extended to display SW:EAW models if I have the time to do this. ---...
In-line assembly not allowed -----------------不允许使用行间汇编 Incompatible storage class -----------------存储类别不相容 Incompatible type conversion --------------------不相容的类型转换 ...
/// 1、“has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.”。 /// 2、“has been blocked by CORS policy: No ...
Performance criteria B description: During the test, degradation of performance is allowed. However, no change of operating state or stored data is allowed to persist after the test. After the test, ...
Android WebView 报 Not allowed to load local resource错误的解决办法 博客地址:http://blog.csdn.net/yuzhiqiang_1993/article/details/76228541
mongod高级查询语句,Javascript查询和$where查询,正则表达式匹配
--retr-symlinks when recursing, get linked-to files (not dir). --preserve-permissions preserve remote file permissions. Recursive download: -r, --recursive specify recursive download. -l, --level...
This function also accepts XML Documents and Window objects as valid arguments (even though they are not DOM Elements). 返回值 jQuery 参数 elements (Element, Array) : 用于封装成jQuery对象的DOM元素 ...
Windows 98 and ME are not supported in BurnInTest version 5.3 and above. Use a version of BurnInTest prior to 5.2 for compatibility with W98 and ME. Windows 95 and Windows NT =======================...
通过console线重置华为交换机登录密码。输入BOOTROM的密码 盒式交换机的某些款型支持使用快捷键“Ctrl+E”进入BootROM主菜单,请根据设备的界面提示操作。 盒式交换机在V100R006C03之前的版本,BootROM默认密码为... ...