I am facing an issue while exporting CSV.
headers look like this:
header('Content-Encoding: unicode');
header('Content-type: text/csv; charset=unicode');
header('Content-Transfer-Encoding: binary');
header('Content-Disposition: attachment; filename="'.$fname.'.csv"');
header("Content-length: 21474836470"); // tells file size set it to maximum
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); //Must revalidate
header('Pragma: no-cache');
header('Expires: 0');
Data is printed correctly but it messed up in CSV I have tried changing Content-Encoding to utf-8, iso-8859-1 and some more.