RE: [PHP-ES] Símbolo del Euro co n la GD

From: Date: Thu, 10 May 2012 11:38:57 +0000
Subject: RE: [PHP-ES] Símbolo del Euro co n la GD
References: 1 2 3 4 5 6 7  Groups: php.general.es 
Request: Send a blank email to general-es+get-65406@lists.php.net to get a copy of this message
> -----Mensaje original----- > De: Eduardo Huertas [mailto:e.huertas@gmail.com] > Enviado el: miércoles, 09 de mayo de 2012 21:42 > Para: php-es@lists.php.net > Asunto: Re: [PHP-ES] Símbolo del Euro con la GD > > El día 9 de mayo de 2012 20:14, Mauricio Rodriguez <maurdz@gmail.com> > escribió: Mirad, ... he creado un imagen.php al margen de mi proyecto, de forma que no interactúa con bases de datos, etc. Lo creo (de cero) con 'joe' (en Debian) y pego este contenido en él (tal y como estoy haciendo en este mensaje): <html> <head><title>Pruebas</title><meta content="text/html; charset=utf-8" http-equiv="Content-Type"></head> <body bgcolor="grey"> <? function save_imagepng($img,$fname){ ob_start();// store output imagePNG($img);// output to buffer file_put_contents($fname, ob_get_contents(), FILE_BINARY);// write buffer to file ob_end_clean();// clear and turn off buffer } $im = imagecreatetruecolor(300, 30); $fondo = imagecolorallocate($im, 0, 0, 0); $color_texto = imagecolorallocate($im, 0, 0, 255); imagecolortransparent($im, $fondo); $valor = "€*&euro;*".utf8_encode('€')."*".utf8_encode('&euro;'); imagestring($im, 5, 0, 0, $valor, $color_texto); $strNom_precio = 'precio'; save_imagepng($im, $strNom_precio.'.png'); $strPrecio = '<img src="'.$strNom_precio.'.png" />'; echo $strPrecio; echo '<br>'; echo $valor; ?> </body> </html> Debería estar en utf-8, tal y como he definido en el charset, ¿no? (mi editor 'joe' no creo que cambie esto). Pues no sale bien ninguno de los símbolos del € del ejemplo para $strPrecio (como imagen). En cambio para $valor (como texto) sí que se imprimen todos (menos el tercero) correctamente.

« previous php.general.es (#65406) next »