问答详情
源自:2-1 如何进行 XML 文件解析前的准备工作

你好老师。我按照你得代码来进行操作,却出现这种异常,为啥?

java.io.UnsupportedEncodingException: UIF-8

at sun.nio.cs.StreamDecoder.forInputStreamReader(Unknown Source)

at java.io.InputStreamReader.<init>(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.createReader(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.setEncoding(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanXMLDeclOrTextDecl(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$XMLDeclDriver.next(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.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)

at javadashen.DOMTest.main(DOMTest.java:26)




提问者:慕虎6315214 2018-07-27 09:38

个回答

  • 九天冰尘
    2018-07-27 11:10:25
    已采纳

    你xml文件保存是的编码方式和你编写程序用软件编码方式不一样。

  • 石好看本好看
    2018-09-29 09:57:37

    怎么改的这种错误