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);
}
if (($in_charset == 'GBK' || $in_charset == 'GB2312') && $out_charset == 'UTF-8') {
return gbk_to_utf8($str);
}
return $str;
}
}
}
這樣就能解決問題了。