An Invalid XML character(Unicode: 0x0) was found in the element content of the document error

前端 未结 1 1909
伪装坚强ぢ
伪装坚强ぢ 2020-12-21 09:49

I have an XML file which gives me the following error while parsing: An Invalid XML character(Unicode: 0x0) was found in the element content of the document error.

I

相关标签:
1条回答
  • 2020-12-21 10:28

    There are two possible explanations. Either the file contains an instance of the Unicode codepoint 0x0, correctly encoded. XML does not allow this character.

    Alternatively, the parser thought it saw an instance of 0x0 because it was decoding the physical bytes of the file incorrectly: that is, the encoding assumed by the XML parser is not the actual encoding of the file.

    When you're dealing with this kind of question you need to be very careful about phrases like "I can read the whole file" and "it looks fine". You can't actually see the bits on the disk, you can only use some kind of viewing tool to interpret them for you, and you need to be clear about what tool you were using and how it was configured.

    0 讨论(0)
提交回复
热议问题