Re: Re: imagettftext and utf-8 (swedish characters)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Frank Arensmeier skrev:
29 feb 2008 kl. 03.41 skrev David Sveningsson:

Nathan Rixham skrev:
before going any further, your HTML page is in UTF-8 yes? with the appropriate content-type line.

Yes, apache uses only utf-8 as charset and the html content-type meta tag is set to utf-8 too. Also, the html form validates at validator.w3.org

plus: first debugging step:
function preview(){
$title = html_entity_decode($_GET['title'], ENT_COMPAT, 'UTF-8');
print_r($title); #verify in view source / web browser that data is correct before it's sent to imagettftext

I see the characters correctly, and page info in firefox says the encoding is utf-8.


From the man page:
"If a character is used in the string which is not supported by the font, a hollow rectangle will replace the character."... If you are 100% sure that the var $title contains a valid UTF-8 encoded text sting (simply output the string to the browser and set the page encoding to UTF-8), then the only thing that is left that might screw up the text-to-image output is the font you are using. As you might know, you can only use TrueType fonts.

I am quite sure that the font supports the characters. I tried a couple of fonts that I use in other programs with utf-8. I am, however, not 100% sure that $title is correct utf-8, but I think it is.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux