PHP generates Chinese code garbled problem solving
The Chinese characters to be processed are then converted to HTML entities and then used by UTF8.
Example code:
//ini_set (' jis-mapped Japanese Font support ', false);
$pic =imagecreate (250,30);
$black =imagecolorallocate ($pic, 0,0,0);
$white =imagecolorallocate ($pic, 255,255,255);
$font = "C://windows//fonts//simhei.ttf";
$str = ' People's Republic of China ';
$str = mb_convert_encoding ($str, "html-entities", "utf-8");//Result: Which team is the first to tee off
Imagettftext ($pic, 10,0,10,20, $white, $font, $STR);
Header ("Content-type:image/jpeg");
$filename = './photo.jpg ';
$im =imagecreatefromjpeg ($filename);
Imagecopymerge ($im, $pic, 0,0,0,0,250,30,50);
Imagejpeg ($im);
Pchart Sample code:
/*
Example14:a Smooth Flat Pie graph
*/1 2
http://www.bkjia.com/PHPjc/632369.html www.bkjia.com true http://www.bkjia.com/PHPjc/632369.html techarticle PHP generated Chinese code garbled problem solving//will be processed by the Chinese characters, first by the UTF8 of Chinese characters into the HTML entity form again use.//Sample code://ini_set (' jis-mapped Japanese Font support ' ...