简体   繁体   English

MalformedByteSequenceException:1字节UTF-8序列的无效字节1

[英]MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence

My file is already encoded with UTF-8 in notepad++, why I am still getting this error? 我的文件已经在记事本++中使用UTF-8编码,为什么仍然出现此错误?

by the way, I'm using jasperreports. 顺便说一句,我正在使用jasperreports。 .jrxml .jrxml

    Oct 30, 2017 12:35:07 AM frmStart jButton_repActionPerformed
SEVERE: null
net.sf.jasperreports.engine.JRException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:249)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:228)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:216)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:170)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:154)
    at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:85)
    at frmStart.jButton_repActionPerformed(frmStart.java:556)

I believe the situation is that Xerces will accept UTF-8 input with a BOM if given a (binary) InputStream to read from, but if you give it a (character-based) reader as input, it will ask the Java I/O library to do the decoding, and that will fail. 我相信情况是,如果给定(二进制)InputStream进行读取,那么Xerces将接受带有BOM的UTF-8输入,但是如果您给它一个(基于字符的)阅读器作为输入,它将询问Java I / O。库执行解码,这将失败。

So it depends how Jasper Reports is invoking Xerces. 因此,这取决于Jasper Reports如何调用Xerces。 I don't know if you have any control over that. 我不知道您是否对此有任何控制权。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MalformedByteSequenceException 1 字节 UTF-8 序列的字节 1 无效 - MalformedByteSequenceException Invalid byte 1 of 1-byte UTF-8 sequence MalformedByteSequenceException:1字节UTF-8序列的无效字节1。 使用希伯来字符时 - MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence. when using Hebrew chars MalformedByteSequenceException:2字节UTF-8序列的无效字节2 - MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence 消息:hadoop中1字节UTF-8序列的无效字节1 - Message: Invalid byte 1 of 1-byte UTF-8 sequence in hadoop 如何修复 1 字节 UTF-8 序列的无效字节 1 - How to fix Invalid byte 1 of 1-byte UTF-8 sequence JAXB错误的说明:1字节UTF-8序列的字节1无效 - Explanation of JAXB error: Invalid byte 1 of 1-byte UTF-8 sequence “ 1字节UTF-8序列的无效字节1”错误 - “Invalid byte 1 of 1-byte UTF-8 sequence” error JRException:1字节UTF-8序列的无效字节1 - JRException: Invalid byte 1 of 1-byte UTF-8 sequence getResponseBodyAsStream返回“ 1字节UTF-8序列的无效字节1” - getResponseBodyAsStream returns “Invalid byte 1 of 1-byte UTF-8 sequence” windowbuilder xwt设计MalformedByteSequenceException:UTF-8序列的无效字节 - windowbuilder xwt design MalformedByteSequenceException: Invalid byte of UTF-8 sequence
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM