Subject: Re: gd, locales, special characters UPDATE
To: pkgsrc-users@NetBSD.org <pkgsrc-users@NetBSD.org>
From: None <firstname.lastname@example.org>
Date: 06/27/2007 18:18:44
Am Mittwoch, 27. Juni 2007 um 00:25 schrieben Sie:
> i don't know if this is the right mailinglist. Perhaps someone can
> give me an hint.
> We use NetBSD 3.1 on our i386 servers. One of our customers needs to
> build graphics with text on the fly with php. He wants to use gd, freetype and truetype
> fonts. The text contains "german umlauts".
> The Problem is that instead of the special german characters
> there are blanks or squares in the graphics.
> I tried to solve the problem by changing the LC_CTYPE and LC_ALL with
> "setlocales(LC ...) in php. I used different names (de, de_DE, de_DE.ISO8859-1, ..) But this
> did not work.
> I also changed the enviroment variables of LC_*, used different
> truetype fonts and used different functions from gd. Also no effect.
> I found that there is only "LC_Messages" in the locales "de" and
> "de_DE" in /usr/pkg/share/locale. This is the path where the freetype-lib for the
> locales. Can this be the reason?
> We have the same problem for about an year ago with typo3. To solve this,
> we changed this server from NetBSD to Linux.
> But i don't want to change the systems of our another servers.
> So does anyone have an hint or an solution?
> Thank you for answers
> We use NEtBSD3.1, apache 2.2.x, php4.4.7 and freetype, gd, php-gd from
> the pkgsrc-2007Q1.
I have some more Information this may help someone to have an idea.
If i transmit the special characters (german umlaute) from an form and
write them with php into an file. The characters are correct in the file.
If i build with the gd library and truetype fonts an picture of the characters, they
are displayed as squares. Setting LC_CTYPE on the enviroment or with
setlocale has no effect.
Then i used "localeconv" in php and this is the output:
Array ( [decimal_point] => . [thousands_sep] => [int_curr_symbol] =>
[currency_symbol] => [mon_decimal_point] =>
[mon_thousands_sep] => [positive_sign] => [negative_sign] => [int_frac_digits] => 127 [frac_digits]
=> 127 [p_cs_precedes] => 127 [p_sep_by_space] => 127 [n_cs_precedes] => 127 [n_sep_by_space] => 127
[p_sign_posn] => 127 [n_sign_posn] => 127 [grouping] => Array ( ) [mon_grouping] => Array ( ) )
Changing LC_CTYPE has no effect on the output.
I used iconv_get_encoding('all') which gives
["input_encoding"]=> string(10) "ISO-8859-1" ["output_encoding"]=> string(10) "ISO-8859-1" ["internal_encoding"]=> string(10) "ISO-8859-1"
Have anyone an idea to solve the problem i wrote in mail yesterday
RM.ROPPERT, it management agentur
Muehlstrasse 6 89077 Ulm
tel: +49.7319386495 fax: +49.7319386496