导入xls格式(2003版本)时会报错提示错误信息
iconv(): Wrong charset, conversion from `CP936' to `UTF-8' is not allowed[/var/www/web/vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/String.php:490]
解决办法:
if (self::getIsIconvEnabled()) {
return iconv($from, $to, $value);
}
修改为
if (self::getIsIconvEnabled()) {
if ($to=='UTF-8' && $from=='CP936') {
return iconv('UTF-8', 'latin1', $value);
}
return iconv($from, $to, $value);
}
修改后
标签:iconv,UTF,getIsIconvEnabled,Wro,self,value,PHPexcel,return From: https://blog.51cto.com/tinywan/6075837