Hello i have utf_8 encoded data but when in export i open it on microsoft excel i get this
here when i opened with notepad
and when i open the file as excel i get this encoding from original file 1252 windows
here is my code
$outputCSv = "";
$someData = array(
array('one' ,'two' ,'three'),
array('واحد', 'اثنان', 'ثلاثة'),
array ('اربعة', 'خمسة', 'ستة'),
array('سبعة', 'ثمانية', 'تسعة'));
foreach ($someData as $data) {
$outputCSv .= implode(',', $data) . "\r\n";
}
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment;filename=csvTest.csv");
header("Content-Encoding: UTF-8");
echo "\xEF\xBB\xBF"; // UTF-8 BOM
echo $outputCSv; exit(0);