Hexadecimal value 0x00 is a invalid character loading XML document

て烟熏妆下的殇ゞ 提交于 2019-12-04 01:26:40

The problem is in the encoding. The byte order marks FF FE are for UTF-16, but the XML header defines encoding="UTF-8".

If you generate the XML yourself, there are two options:

a) write a UTF-8 header: EF BB BF

b) define UTF-16 encoding: encoding="UTF-16"

If you receive the XML from someone else, there are also two options:

A) tell the author to fix the XML according a) or b)

B) sanitize the input in your application (not preferred)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!