php绘制中文的乱码问题
- PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php// 1. $img=imagecreatetruecolor(400,400); $white=imagecolorallocate($img, 255, 255, 255); $gray=imagecolorallocate($img, 0xC0, 0xC0, 0xC0); $darkgray=imagecolorallocate($img, 0x90, 0x90, 0x90); $navy=imagecolorallocate($img, 0, 0, 0x80); $darknavy=imagecolorallocate($img, 0, 0, 0x50); $red= imagecolorallocate($img, 0xFF, 0, 0); $darkred=imagecolorallocate($img, 0x90, 0, 0); // 2. imagefill($img,0,0,$red); imagettftext($img,20,-60,60,150,$darknavy,"simhei.ttf","一二三"); // 3. header("Content-Type:image/gif"); imagegif($img); // 4. imagedestroy($img); "一二三"无法显示,只有几个方框,怎样解决乱码问题?先谢谢!!!
------解决方案--------------------
imagettftext($img,20,-60,60,150,$darknavy,"simhei.ttf", iconv('gbk', 'utf-8', "一二三") );
主要更新介绍: 完美整合Discuz!论坛,实现一站式登陆、退出、注册; 同步所有会员资料; 新增购物车功能,商品购买更加方便、快捷; 新增部分快捷菜单,网站访问更加方便; 限制首页商品、店铺标题显示长度; 修正会员后台管理不能更改密码的错误; 完善商品显示页面所有功能链接; 修正后台标签管理部分错误; 修正前台学校列表不按后台顺序显示的错误; 修正搜索功能中学校名称过长导致显示紊乱的现象; 修正










