Page 1 of 3

SOLUTION: UTF-8 in PDF

Posted: Wed Aug 03, 2011 1:58 pm
by zazzium
I thought I share my solution for a little problem.
I had a problem expording Special characters like ä, ö, ü, õ etc. to PDF.

Adding one line in run_report_pdf_v2.php (row 155) solved the problem for me.

data = utf8_decode($data)

Re: SOLUTION: UTF-8 in PDF

Posted: Fri Aug 05, 2011 4:20 am
by admin
zazzium,

We will include this in the next release.

Thanks for your help, we appreciate it!

Steven

Re: SOLUTION: UTF-8 in PDF

Posted: Tue Aug 07, 2012 3:18 pm
by zazzium
utf8_decode($data) does not work with characters like
œ š Ÿ ž ƒ € (output- ? ? ? ? ? ? ?)

..but replaceing it with mb_convert_encoding works like charm
$data = mb_convert_encoding($data, "WINDOWS-1252", "UTF-8");

Re: SOLUTION: UTF-8 in PDF

Posted: Wed Aug 08, 2012 4:48 pm
by admin
zazzium,

I have made this change for the next build and you will be imortalised with a comment next to it.

Steven

Re: SOLUTION: UTF-8 in PDF

Posted: Sun Aug 12, 2012 2:28 am
by flsd
Hi,

Nor utf8_decode($data) neither $data = mb_convert_encoding($data, "WINDOWS-1252", "UTF-8") works with Greek characters like
γ,Γ,δ,Δ,θ,Θ,λ,Λ,μ,ξ,Ξ,σ,Σ,ψ,Ψ, ω,Ω etc (output- ? ? ? ? ? ? ?).

Is there anything else that could fix the problem?

Thanks
flsd

Re: SOLUTION: UTF-8 in PDF

Posted: Mon Aug 13, 2012 1:48 am
by admin
fsld,

Have you tried the latest version?

2.7.4.3

It has zazzium's fix.

Steven

Re: SOLUTION: UTF-8 in PDF

Posted: Mon Aug 13, 2012 6:39 am
by flsd
Hi Steven,

Yes, I have tried the last version 2.7.4.3.

Also, if this can help, printing of a transaction using the "print" button, displays correctly only the first 7 characters from the description and 'cut' the rest. The use of 'printPDF' button, displays the entire text, but in the wrong place and with ???????????.

Thanks,
flsd

Re: SOLUTION: UTF-8 in PDF

Posted: Mon Aug 13, 2012 12:42 pm
by zazzium
flsd,

Greek has completly different ecoding (ISO-8859-7).
Theoretically it should be mb_convert_encoding($data, "ISO-8859-7", "UTF-8"), but it does not work.

Sorry, i couldn't find a easy fix for greek, u have to play around with encoding.

Re: SOLUTION: UTF-8 in PDF

Posted: Tue Aug 14, 2012 5:40 am
by admin
flsd,

Can you post a screen capture of what you mean?

Steven

Re: SOLUTION: UTF-8 in PDF

Posted: Wed Aug 15, 2012 4:08 am
by flsd
Steven,

Here are the screen captures.
pdf.png
html.png
Thanks,
flsd