Wordpress导出不适用于阿拉伯字符串



我正试图将我的帖子数据导出到csv/xls中,但两者都返回"??"而不是阿拉伯字符串。我设置了标题。。。

//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");

如果将其添加到标头输出的末尾,效果会好吗?

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

在这里和这里找到的。

最新更新