views:

33

answers:

1

Hi,

I am designing a small registration system. In this system, people write their name and surname in a form. This information is later saved in a database. The admin can later generate a personalized PDF containing this information (kind of pre-filled form).

I am struggling to understand how I should plan the database and the PDF generation in order to handle correctly as many characters as possible.

I would like to handle/display correclty at least all European Languages (Italian, French, Spanish but also Slavic Languages, German Languages, ecc..), as most of the people who will sign-up will come from all corners of Europe. Some example of "strange" characters may be "òàè říčá öåä"

Any hints? Thanks.

A: 

Simply use Unicode and, more specifically, UTF-8.

Also, you probably need a font with a wide character support, such as Arial Unicode.

Update

Here's a good overview about UTF-8 in web apps:

Since you refer to accented letters as "strange characters", I also recommend this article:

Neither of these links cover PDF libraries but once you get the fundamentals you should be able to evaluate the Unicode abilities of your library of choice.

Álvaro G. Vicario
Thanks, Alvaro. But how to handle it practically?When I create the database I have to chose a "collation": which to choose? When I put the info from the form into the DB and when I retrieve it,shall I use some encoding functions? And for the generation of the PDF file, how can I do to handle correctly those chars? I tried with PDFlib but couldn't get character to display correctly. It is not clear to me how to add a new font and try.
Danilo