0
/*filePath: Its a <?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>*/

//My Block of Code

String content = new String(Files.readAllBytes(Paths.get(filePath)));
content.replace('\u0002',' ');
Document doc = dBuilder.parse(new InputSource(new ByteArrayInputStream(content.getBytes("Windows-1252")))); // Getting fatal error at this point because that unicode haven't replaced.
doc.getDocumentElement().normalize();



[Fatal Error] :40799:8: An invalid XML character (Unicode: 0x2) was found in the element content of the document.

尝试了不同的解决方案,但没有运气。提前致谢。

4

0 回答 0