php duty imagettftext() unicode
i'm controlling php duty imagettftext() modify calm gif image. calm i am converting unicode characters including japanese. all works glorious internal accessory (ubuntu 7.10), nonetheless webhost server, japanese characters mangled. causing difference? all should encoded utf-8.
broken settlement webhost server:
copy repremand settlement internal machine:
copy phpinfo() internal machine:
copy phpinfo() webhost server:
code:
mb_language('uni');
mb_internal_encoding('utf-8');
header('content-type: image/gif');
$text = '';
$font = './cyberbit.ttf';
// emanate image
$im = imagecreatetruecolor(160, 160);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
// emanate colors
imagefilledrectangle($im, 0, 0, 159, 159, $white);
// supplement text
imagettftext($im, 12, 0, 20, 20, $black, $font, $text);
imagegif($im);
imagedestroy($im);
Comments
Post a Comment