<? The XML version="1.0" encoding="GBK"?>
]]> CodePudding user response: CodePudding user response: CodePudding user response: CodePudding user response:
Data is read in buf, print buf also same as the file
Read the XML file to buf
XmlParseMemory (buf, xmlLen)//an error here
No other code processing, error content:
Encoding error: input conversion failed due to the input error, bytes 0 xfe x3c x9f 0 0 0 x2f
Encoding error: input conversion failed due to the input error, bytes 0 xfe x3c x9f 0 0 0 x2f
The I/O error: encoder error
The Entity: line 1: the parser error: the CData section not finished
The Entity:, line1: parser error: Premature end of data in the tag tiripPackage line 1
Ns: xsi="http://www.w3.org/2001/XMLSchema-instance" & gt; <body>
Description:
1. The original code, XML file can't get the machine, so the XML file contents may be there is typing error, the file itself is no problem, if there are any abnormalities can be adaptively adjusted
2. 将李改为其它名字,不报错,正常
How is a rectangle?
Try to utf-8
===& gt;
<? The XML version="1.0" encoding="GB18030"?>
Seemingly libxml2 GBK support is not complete
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html