PHP hindii 编码问题

时间:2021-02-27 10:32:51

标签: php wordpress powerpoint encode

我的自定义 WordPress 插件从印地语数据库中获取帖子内容。我正在生成这样的文本文件:

header("Content-Type: text/plain; charset=utf-16le");
header('Content-Disposition: attachment; filename="'. $file_base .'-'. $post_date .'.txt"');

echo $text;

当我将文本文件导入 PowerPoint 2007 时,它显示如下:

enter image description here

但是如果我使用 Windows 文本编辑器打开文本文件,然后以 UTF-16LE 格式保存。然后 PowerPoint 正确阅读。

我花了一天时间寻找解决方案但失败了。可能是什么问题?

0 个答案:

没有答案