intive-FDV / DynamicJasper

Dynamic Reports using Jasper Reports
http://intive-fdv.github.io/DynamicJasper/
GNU Lesser General Public License v3.0
241 stars 128 forks source link

UTF-8 characters are not displayed #52

Open AbedHadri opened 6 years ago

AbedHadri commented 6 years ago

First of all thank you guys for making this amazing tool. When I try to use any UTF-8 characters (in my case Turkish characters such as ğ - i -ş -ç ..) nothing is displayed where these character should show ( for example kişi word is displayed as kii 'n the output PDF). I have attempted to solve it by setting DynamicReportBuilder in this way : drb.setDefaultEncoding("UTF-8"); as well as set Style of PDF file as : style.setPdfEncoding("UTF-8"); , I have also tried to add jp.setLocaleCode("tr-TR"); to the JasperPrint . However , none of these worked. Is there something I can do about this? . thanks in advance.

ginalpisti commented 6 years ago

What fonts are you using? The default fonts could be the problem. We are using Arial bundled in our jar in ttfs with DynamicJasper, and the above mentioned characters show up just fine. (Currently the used encoding is ar.com.fdvs.dj.domain.constants.Font.PDF_ENCODING_CP1250_Central_European = "CP1250")

When using JasperReports library we set our text fields and static texts to DejaVu Sans.