请问,PHP中我用GD库函数生成中文字的图片,为什么显示出来的中文字是方框?(文字已经转utf-8了)
<?phpheader("content-type:image/jpeg;charset=utf-8");$str="马云";$str=iconv("gb2312","u...
<?php
header("content-type:image/jpeg; charset=utf-8");
$str = "马云";
$str = iconv("gb2312","utf-8",$str);
$img1 = imagecreate(80,30);
imagecolorallocate($img1,0xe6,0xe6,0xe6);//背景色
$font="BOOKOS.TTF";
$fcol=imagecolorallocate($img1,80,80,80); //前景色
imagefttext($img1,14, 0, 20, 15, $fcol, $font, $str);
imagejpeg($img1);
imagedestroy($img1);
?> 展开
header("content-type:image/jpeg; charset=utf-8");
$str = "马云";
$str = iconv("gb2312","utf-8",$str);
$img1 = imagecreate(80,30);
imagecolorallocate($img1,0xe6,0xe6,0xe6);//背景色
$font="BOOKOS.TTF";
$fcol=imagecolorallocate($img1,80,80,80); //前景色
imagefttext($img1,14, 0, 20, 15, $fcol, $font, $str);
imagejpeg($img1);
imagedestroy($img1);
?> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询