我试图使用 PHP 以 xls 格式出色地导出。但它不支持缅甸语



请查找示例代码

header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Length: " . strlen(content));
header("Content-type: application/vnd.ms-excel");
header("Content-type: application/octet-stream, charset=UTF-8; encoding=UTF-8");
header("Content-Disposition: attachment; filename=".$filename.".xls");
echo $xls_output;
exit;``

谢谢

我认为如果在流的开头找到 bom,excel 会将您的流视为 utf-8。尝试在标头之后使用 UTF-8 BOM 开始输出流,如下所示:

echo pack("CCC",0xef,0xbb,0xbf);
echo $xls_output;

希望对您有所帮助!

您需要将编码更改为 Unicode,并可能将字符集更改为 UTF-16

以下链接将根据语言指导您进行正确的设置: http://www.unicode.org/faq/myanmar.html

您还必须在计算机上安装该字体。

最新更新