I am importing and excel file(.csv) which contains arabic characters and English. When I extracting the content using 'file_get_contents', Everything works great.
But the arabic string 'يض' comes out as ????
I am importing and excel file(.csv) which contains arabic characters and English. When I extracting the content using 'file_get_contents', Everything works great.
But the arabic string 'يض' comes out as ????
file_get_contents
is known to often misinterpret UTF8.
Can you try something like this:
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));
}