Jump to content

how to exportt encoded utf-8 csv?


megetron

Recommended Posts

Hello,

I am trying to export data from database. the exported data is creted with wrong encoding.

 

I am using this code:

header("Pragma: public");

header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');

header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

header("Cache-Control: private",false);

header("Content-Type: application/force-download;charset=utf-8; encoding=UTF-8");

header('Content-Disposition: attachment; filename="'.$newFile.'"');

header("Content-Transfer-Encoding: binary");

header('Content-Length: '.@filesize($path));

 

 

Please help with the encoding. Thanks.

Link to comment
https://forums.phpfreaks.com/topic/258561-how-to-exportt-encoded-utf-8-csv/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.