AOS PDF Template charset encoding issue

i have an issue with character encoding in PDF Templates used for quotation conversion.
Every time i use the apostrophe character ( ’ ) i have a an empty rectangle printed out in my PDF document; if i use the charachter ( ` ) instead, i have no issue.
I use SuiteCRM 7.2.1 with Italian language pack and UTF-8 charset.
I tryed also to use ISO8859-1 charset but the issue is always there.

Thank you in advance.

I’ve did some more testing in the last few days and I’ve found a potential cause for the issue.
I’ve used a VM (Ubuntu 14.10 64bit on Virtualbox with Bitnami stack) with an istance of SuiteCRM 7.1.4 installed on: it worked fine (no typo in PDF) until i’ve upgraded it to SuiteCRM 7.2.1, then the issue has appeared. I’ve tried to upgrade it again to SuiteCRM 7.2.2 but the issue was still there.
I’ve noticed that the update had replaced the file “generatePdf.php” located in “/opt/suitecrm-7.1.4-0/apps/suitecrm/htdocs/modules/AOS_PDF_Templates” with a new one, so I’ve tried to replace it with the older one (that i’ve backed up before) and everything came back to work!
I’ve noticed that the new file if bigger (14251 byte) than the older (14165) but for now i cannot say more than this (i’m not a programmer unfortunately).
I’ve attached the old file ( and the new one ( to this post.
I hope this can help to address the problem.

This looks to be caused by the preg_replace matching ‘@&#(\d+);@e’ and replacing with ‘chr(\1)’. Could be fixed by writing a regex in the $search to find this character and replace it in the $replace ensuring both are before the ‘@&#(\d+);@e’ line.


and replace with “’” appears to work but has not been properly tested.