[reportlab-users] How to change PDF document encoding to iso-8859-15

Andy Robinson andy at reportlab.com
Thu Jan 20 03:41:16 EST 2011


On 20 January 2011 03:58, Enis Afgan <eafgan at emory.edu> wrote:

> Hello,

> I'm getting familiar with ReportLab but I ran into an issue I haven't been

> able to resolve for a few of hours now so I decided to ask here.

> I need to generate PDF documents using iso-8859-15 (latin-9) encoding but


Hi Enis,

I know this problem well, as my wife has the same character in her family name!

It's not about encodings, it's about the fonts.

You are using the default font, Helvetica, which simply lacks the
glyphs in the font. It's a 'type 1' font which means only 255
characters can be defined, so it only has the Latin-1 characters.
Try explicitly registering and using a TrueType font - they are
generally unicode-based and often include Slavic characters. If you
haven't done this before, there is a section of the user guide on
fonts. DejaVu, Lucida Sans or many of the popular Microsoft fonts
should work.

The strings you pass into our API should always be unicode, or utf-8 encoded.

--
Andy Robinson
Managing Director
ReportLab Europe Ltd.


More information about the reportlab-users mailing list