Jump to content
JasperReports Library 7.0 is now available ×

Non-ASCII Characters Display Incorrectly


jgaughan

Recommended Posts

I have an issue where non-ASCII characters (e.g. accented characters) do not display correctly when exporting to PDF.

JasperReports is integrated into an application created by my company. In this specific instance, we load a report and fill it multiple times for multiple targets: printer, database (serialized XML), and exported to PDF.

The report fills correctly all three times. Text is translated from a database table using an internal framework, and is placed in the report as a string correctly. I can inspect the data in the debugger and see it is correct. The print version displays correctly. The database version does as well, if I load it and print it. The PDF exported version has boxes where the characters are that take more than 7 bits. If I export to XML, the data is correct.

It looks like the problem is either the encoding of the PDF, the code page used, or the font embedded. The report uses Lucida Sans Typewriter. The font works fine in the other reports, and even in Word or other applications.

Is there a property I need to add to the parameter map passed in to the exporter? The application is using JasperReports 3.5.2 and iText 2.1.6.



Post Edited by jgaughan at 08/24/2010 19:37
Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I changed the PDF encoding from UTF-8 to ISO-8859-1 and the problem went away. This is not an ideal solution for true i18n, but for software being deployed only in the U.S. for the "en_US" and "es_MX" locales, it will work.



Post Edited by jgaughan at 09/10/2010 18:15
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...