0

我从我用 Delphi7 编写的应用程序生成 graphml 文件。一切都很好,除了当我使用 yEd 图形编辑器打开一些我的 graphml 文件时,它会引发这样的错误。

test.graphml.
    at B.A.A.I.A.ā(Unknown Source)
    at B.A.A.I.D.ā(Unknown Source)
    at B.A.A.I.D.ă(Unknown Source)
    at B.A.A.B$4.run(Unknown Source)
    at B.A.A.U.Ċ(Unknown Source)
    at B.A.A.U$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: D.H.B.B.a: IOException :Invalid byte 1 of 1-byte UTF-8 sequence.
    at D.H.B.B._.ā(Unknown Source)
    at D.H.B.A$13.ā(Unknown Source)
    at D.H.B.A.ā(Unknown Source)
    at D.H.B.A.ā(Unknown Source)
    at D.H.S.ā(Unknown Source)
    at B.A.A.I.A.A.ā(Unknown Source)
    at B.A.A.B.I.O.Ă(Unknown Source)
    at B.A.A.B.I.O.ā(Unknown Source)
    at B.A.A.O.E.ā(Unknown Source)
    ... 7 more
Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.peekChar(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
    ... 16 more

我是如何解决这个问题的?先感谢您。

4

1 回答 1

0

我认为问题应该来自 Unicode无效字节序列问题但没有你的文件我只能猜测。

我认为您可以从非 Unicode 编码文件加载字符串并直接使用它而不转换为 Unicode 编码。请尝试通过查看这篇文章将这些字符串转换为 Unicode 。

于 2012-01-22T21:47:24.550 回答