Forum Moderators: coopster

Message Too Old, No Replies

imagettftext and special chars.

         

sifredi

2:52 pm on Aug 24, 2005 (gmt 0)

10+ Year Member



I have a problem related to swedish or german characters (åäöÅÄÖ). I have made a page (image.php) that uses the $_GET['text'] variable to render a .png image from text using the imagettftext function and a custom true type font. It all works fine, except for the special chars.

I use ISO-8859-1 as encoding and printing out simple a simple "Ö" using HTML is no problem. But the image engine doesn't like it.

Whats strange is that I can call this file externally like

image.php?text=ÅÄÖ
and it works. But when I try to pick up text from my database and render it via the image.php file like
image.php?text=$row->text
it breaks down.

I have tried everything from urldecode() to custom made decodes, utf8 encoding. Could anyone explain to me how these things work, since I couldn't find anything that explains it?

thanks a lot.

jatar_k

4:31 pm on Aug 26, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



my first thought is whether this method

image.php?text=$row->text

is actually writing to the url the same thing as the one above it? What do you see in the url? does it show the right characters but then not in the image?