[#9106] - Compile JRXML encoding problem

Category:
Bug report
Priority:
Low
Status:
New
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:

When I use JasperCompileManager to compile my jrxml template file:
JasperReport jasperReport = JasperCompileManager.compileReport(new ByteArrayInputStream(templateBytes));

Jasper library generate temporary tmp_file.java.
Then JrJavacCompiler compile this tmp_file.java into tmp_file.class. But compiler use OS encoding, in my case is cp1251
and I have an exception: unmappable character for encoding Cp1251.

This problem resolved by setting enviroment variable JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF8.

I think, better get encoding from System.getProperty("file.encoding") or add something like parameter to JasperCompileManager to set encoding in code. And set this encoding in JRJavacCompiler.compileClasses(File[] sourceFiles, String classpath) method as javac command argument.

v6.3.0
JRJavacCompiler
maxim260588's picture
Joined: Sep 6 2016 - 3:39am
Last seen: 3 years 2 months ago
Feedback
randomness