birt打印和导出,如果xml中有中文,会报错如下,并且页面显示空白页,导出的xls为0字节
Caused by: Error.DesignFileException.INVALID_XML - 2 errors found!
1.) ( line = 10, tag = property) org.eclipse.birt.report.model.util.XMLParserEx
ception (code = Error.XMLParserException.SAX_ERROR, message : Line Number:10 Err
or Code:Error.XMLParserException.SAX_ERROR Exception:org.apache.xerces.impl.io.M
alformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence. Message:
SAX detected an error with the basic XML syntax of the file. )
2.) ( line = 10) org.xml.sax.SAXParseException (message : Invalid byte 2 of 2-b
yte UTF-8 sequence.)
解决办法:
增加环境变量JAVA_TOOL_OPTIONS 值为-Dfile.encoding=UTF-8