[#9106] - Compile JRXML encoding problem

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

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: 1 year 11 months ago
Feedback
randomness