【发布时间】:2011-07-19 02:19:33
【问题描述】:
ob_start();
echo 'Désçàui';
header("Content-Type: application/vnd.ms-excel; charset=utf-8");
header("Content-type: application/x-msexcel; charset=utf-8");
header("Content-Disposition: attachment; filename=Test.xls");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
ob_end_flush();
我在 excel 文件中得到的是Désçà ui
但是,当我尝试时,我确实得到了 Désçàui
ob_start();
echo 'Désçàui';
header("Content-Type: text/html; charset=utf-8");
ob_end_flush();
任何帮助专家?
PS。该文件以标题/编码 Unicode(Utf-8) 保存在 DW 中。
【问题讨论】:
-
一个实体只能有一种内容类型。
-
我认为为甚至不是文本的 MIME 类型提供 charset 属性是没有意义的。
-
从什么时候开始将纯文本块视为 Excel 文件?