Support (offered by community volunteers) > Internationalization and Localization
Special characters not encoded correctly when creating printable letters (PDF)
resga:
If I have a user with special characters like æ, å or ø or umlaut in their name, and select "Create Printable Letters (PDF)" the name is printed like this "Ã…lice Ægdav".
I am using version 3.3.3, and it happens both locally and at drupal.demo.civicrm.org
Do you guys know how to fix this issue? Thanks in advance!
A related post: http://forum.civicrm.org/index.php/topic,14957.0.html
xavier:
Hi,
did experiment the same issue indeed.
http://www.tcpdf.org/
The library used is supposed to handle utf8, as civi uses internally.
It would be create if you could investigate at what point the text get fubared. Looks like it's latin1 that is read as utf8 (or vice versa)
--- Quote from: resga on February 01, 2011, 10:34:35 am ---If I have a user with special characters like æ, å or ø or umlaut in their name, and select "Create Printable Letters (PDF)" the name is printed like this "Ã…lice Ægdav".
--- End quote ---
resga:
I am very willing to investigate, do you have any suggestions where I should start?
Should I perhaps be looking at the Utils.php file in the sites/all/modules/civicrm/CRM/Utils/PDF folder? Or the database? It is utf8_unicode_ci if that makes any difference...
Thank you for the quick answer!
Donald Lobo:
the function that generates the PDF is:
CRM_Utils_PDF_Utils::html2pdf
which is called from:
CRM/Contact/Form/Task/PDFLetterCommon.php (line 272 or so)
if you do fix it, please post your solution here so we can incorporate it into the codebase
thanx
lobo
resga:
I found this suggestion somewhere, and now æ, å, ø, é, ü, ñ and other special characters work in printable letters (PDF):
Change line 145 in modules/civicrm/CRM/Utils/PDF/Utils.php from
$dompdf->load_html( $html );
to
$dompdf->load_html( utf8_decode( $html ) );
I haven't made a patch before, so I hope I haven't messed up too badly...
Navigation
[0] Message Index
[#] Next page
Go to full version