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

问题描述 投票:1回答:1

我正在尝试将我的帖子数据导出到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");
php wordpress xls
1个回答
0
投票

如果将其添加到标题输出的末尾,是否可行?

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

[Found it herehere

© www.soinside.com 2019 - 2024. All rights reserved.