1

I am trying to export my post data into csv/xls but both return '???' instead of arabic string. I have set headers...

//output the headers for the XLS file
header('Content-Encoding: UTF-8');
header("Content-Type: Application/vnd.ms-excel; charset=utf-8");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Description: File Transfer');
header("Content-Disposition: Attachment; Filename=\"$filename\"");
header("Expires: 0");
header("Pragma: public");

1 Answers1

0

Does it work if you add this to the end of the header output?

print chr(255) . chr(254) . mb_convert_encoding($csv_output, 'UTF-16LE', 'UTF-8');

Found it here and here .