我正在导入包含阿拉伯字符和英语的excel文件(.csv)。当我使用"file_get_contents"提取内容时,一切正常。
但是阿拉伯语字符串"يض"是????
众所周知
,file_get_contents
经常误解UTF8。
你能试试这样吗:
function file_get_contents_utf8($fn) {
$content = file_get_contents($fn);
return mb_convert_encoding($content, 'UTF-8',
mb_detect_encoding($content, 'UTF-8, ISO-8859-1', true));
}