Page 1 of 1

TCPDF and German umlauts in nubuilder 4.5

Posted: Sun Apr 18, 2021 2:48 pm
by mikevb
On the update overview of nuBuilder 4.5 I found under Fixes: "German umlauts not shown in reports". I created a new database and did a clean, fresh install of nuBuilder 4.5. Populated the database with my data and created an SQL query and a report using nubuilder's report designer. My data contains German names with umlauts. TCPDF sometimes prints them and sometimes not. I have a row with two times the letter ö and this upsets TCPDF very much. It throws a whole browser-page of errors at me. If I change one of thes ö in the database to o, everything is fine and the pdf is generated as expected.
I found out, that the only font that can handle this row with two ö is times with font weight normal. If I set font weight to bold, it's not working either.
Using my search engine I found that many had good results using freesans but that doesn't work for me. I checked also my versions and settings: PHP 7.4.16, default_charset UTF-8 / mysql Ver 15.1 Distrib 10.2.37-MariaDB, for Linux (x86_64) using readline 5.1, Encoding UTF-8 Unicode, Collation utf8_general_ci.
Because that solved problems before, I increased the memory_limit in php settings to 1GB, but that didn't make a difference. Attached is a file with the error messages.
Nubuilder is an excellent tool and I would really like to generate my reports with umlauts. If somebody maybe has another hint, I would love to try it. Otherwise I'm stuck with the font "times" or without umlauts :roll:
Cheers Mike

Re: TCPDF and German umlauts in nubuilder 4.5

Posted: Sun Apr 18, 2021 6:27 pm
by kev1n
Hi,

Using the latest nuBuilder version, German umlauts are shown correctly (at least for me).
I used the default settings (without changing any fonts etc.)

Re: TCPDF and German umlauts in nubuilder 4.5

Posted: Mon Apr 19, 2021 4:38 am
by mikevb
Wow you're quick - thanks Kevin!
I tried about everything I could think of and was able to narrow it down to a tiny table with one record that reliably throws an error.
1) I created a testtable (SQL attached)
2) I created a Fast-Report with the two columns - no other modifications
3) When I run the Fast Report, the Error is generated.
Then I went into the table and just deleted one of the words "Firstname" or "Lastname" but left "Jörgens" untouched. The report is generated as expected.
I was not able to figure out why these words in combination create an error, but "Jörgens" on it's own or with just one word leading or trailing doesn't???
Cheers Mike
Fast Report 0.png

Re: TCPDF and German umlauts in nubuilder 4.5

Posted: Mon Apr 19, 2021 9:00 am
by kev1n
I added some utf8_encode() in nurunpdf.php which seems to fix it.

Re: TCPDF and German umlauts in nubuilder 4.5

Posted: Mon Apr 19, 2021 1:30 pm
by mikevb
Thank you Kevin, that works perfect!

Re: TCPDF and German umlauts in nubuilder 4.5

Posted: Wed Apr 21, 2021 11:30 am
by kev1n
Great! Thank you for the feedback.