I have to use Polish language to fill my report content, so I have to use diacritic chars (ą, ć, ę, ł, ó, ż, ź). And I have problem with them, they are skipped after exporting jasper print to an output. When I write in a template "lubię żółwie"
(means "I like turtles" in Polish), an output pdf contains only "lubi wie"
(btw it means "he likes he knows" - so it changes a lot ;)). Even there are no empty spaces in place of missing letters. They are just skipped.
An additional hint is it doesn't matter if those string are static text in the report or dynamic $P{}
My question is: "How to make them appear"?
I was trying (without success):
- Using method
setParameter(JRExporterParameter.CHARACTER_ENCODING, "UTF-8")
ofJRPdfExporter
- Setting
JRProperties.setProperty("net.sf.jasperreports.default.pdf.encoding", "UTF-8");
- Setting
JRProperties.setProperty("net.sf.jasperreports.export.character.encoding", "UTF-8");
- Putting REPORT_LOCALE into parameter map (
JasperFillManager.fillReport
)
SOLUTION: It turend out that in my case it's enough to attach a font to class path, define own jasperreports_extension.properties and fonts.xml. Details here. If somebody uses Grails framework to do it (like me) here is more accurate example. Addidtional and required step is setting JRProperties.setProperty("net.sf.jasperreports.default.pdf.encoding", "Cp1250")
as Wojtek wrote. Still don't know why but I'll update the solution when I know an answer.