Phpcms采集时出现编码转化错误的解决方法 phpcms在本地测试正常 传到虚拟主机上采集的时候出现这个错误 Warning: mb_convert_encoding() [function.mb-convert-encoding,: Unknown encoding ”UTF-8//IGNORE” 看了半天源码,发现是phpcms编码转化的BUG,修改步骤如下: 打开\phpcms\libs\functions\global.func.php文件 找到 复制代码代码如下: /** * iconv 编辑转换 */ 修改代码,红色的那一句 复制代码代码如下: /** * iconv 编辑转换 */ if (!function_exists('iconv')) { function iconv($in_charset, $out_charset, $str) { $in_charset = strtoupper($in_charset); $out_charset = strtoupper($out_charset); if (function_exists('mb_convert_encoding')) { return mb_convert_encoding($str] str_replace('//IGNORE','',$out_charset)] str_replace('//IGNORE','',$in_charset)); } else { pc_base::load_sys_func('iconv'); $in_charset = strtoupper($in_charset); $out_charset = strtoupper($out_charset); if ($in_charset == 'UTF-8' && ($out_charset == 'GBK' || $out_charset == 'GB2312')) { return utf8_to_gbk($str);...
内容已隐藏,请关注公众号输入验证码查看
本帖支持关注公众号查看
【无套路 无套路 无套路 扫描二维码关注公众号发送【验证码】收到验证码 在上面输入点击提交查看即可显示隐藏内容】
|