Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

SOLUTION: UTF-8 in PDF

zazzium
Posts: 84
Joined: Mon Jul 04, 2011 12:52 am

SOLUTION: UTF-8 in PDF

Unread post 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)
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SOLUTION: UTF-8 in PDF

Unread post by admin »

zazzium,

We will include this in the next release.

Thanks for your help, we appreciate it!

Steven
zazzium
Posts: 84
Joined: Mon Jul 04, 2011 12:52 am

Re: SOLUTION: UTF-8 in PDF

Unread post 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");
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SOLUTION: UTF-8 in PDF

Unread post by admin »

zazzium,

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

Steven
flsd
Posts: 32
Joined: Tue Jul 03, 2012 6:50 pm

Re: SOLUTION: UTF-8 in PDF

Unread post 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
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SOLUTION: UTF-8 in PDF

Unread post by admin »

fsld,

Have you tried the latest version?

2.7.4.3

It has zazzium's fix.

Steven
flsd
Posts: 32
Joined: Tue Jul 03, 2012 6:50 pm

Re: SOLUTION: UTF-8 in PDF

Unread post 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
zazzium
Posts: 84
Joined: Mon Jul 04, 2011 12:52 am

Re: SOLUTION: UTF-8 in PDF

Unread post 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.
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SOLUTION: UTF-8 in PDF

Unread post by admin »

flsd,

Can you post a screen capture of what you mean?

Steven
flsd
Posts: 32
Joined: Tue Jul 03, 2012 6:50 pm

Re: SOLUTION: UTF-8 in PDF

Unread post by flsd »

Steven,

Here are the screen captures.
pdf.png
html.png
Thanks,
flsd
You do not have the required permissions to view the files attached to this post.
Post Reply