博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PHP加文字水印时报错 imagettftext() [function.imagettftext]: any2eucjp()
阅读量:4361 次
发布时间:2019-06-07

本文共 1012 字,大约阅读时间需要 3 分钟。

解决办法1:

由于GD库编译时添加了: --enable-gd-jis-conv    的支持(   GD: Enable JIS-mapped Japanese font ) , 在phpinfo()里也可以看到:JIS-mapped Japanese Font Support的支持为enable,需要重新编译PHP,在编译PHP时,去掉 --enable-gd-jis-conv即可

去掉编译选项“--enable-gd-jis-conv”

 

关闭GD库中 “JIS-mapped Japanese Font Support”

贴上官方的解释:

There is no fallback ot UTF-8. It accepts UTF-8 by default. The problem
about JIS is when you pass a non UTF-8 string, it can be seen as JIS
enconded string.
About the mbstring issues, I have no idea how it works and how it
affects the input parameters. It is something happening before we got
the hand in the gd function.

解决办法2:

mb_convert_encoding($markWords,"html-entities","UTF-8")

 

/**

* 将文本由UTF8编码转化为数字形式编码(HTML实体)
* @param $arr 该参数可以为数组或者string
* @author Steven lxq70361@qq.com
*/ 
function iconv_arr($arr){ 
if(is_array($arr)){
   foreach($arr as $k=>$v){
    $arr[$k] = iconv_arr($v);
   }
   
}else{
   $arr = mb_convert_encoding($arr, "html-entities","utf-8" );
}
return $arr;
}
?>

 

 

参考:

 

转载于:https://www.cnblogs.com/hubo2/archive/2012/09/03/2669447.html

你可能感兴趣的文章
VC++一些开发心得与调试技巧
查看>>
python 归纳 (二八)_python测试使用快速上手
查看>>
oracle 11g虚拟机安装环境配置脚本
查看>>
高并发的初识和想法
查看>>
[HihoCoder-1424] Asa's Chess Problem
查看>>
事件委托
查看>>
利用for循环找出1000以内的质数
查看>>
使用jQuery快速高效制作网页交互特效(5)
查看>>
C++学习(十一)(C语言部分)之 练习
查看>>
JMS【三】--ActiveMQ简单的HelloWorld实例
查看>>
visual c++基础(windows窗口程序解析)
查看>>
【趣味】0基础快速掌握区块链服务关键概念
查看>>
【LG 4831】Scarlet loves WenHuaKe(生成函数)
查看>>
git hook 自动部署
查看>>
Redis总结(四)Redis 的持久化(转载)
查看>>
Java03动手动脑
查看>>
使用Java HttpComponent/HttpClinet 调用 WebAPI问题的解决
查看>>
使用ROW_NUMBER()查询:列名 'RowNumber' 无效。
查看>>
.2-Vue源码起步(2)
查看>>
java中比较字符串方法
查看>>