gpt4 book ai didi

php - 使用 PHP 和 MySql 中的印地语 (Unicode) 内容将数据导出到 Excel

转载 作者:行者123 更新时间:2023-11-29 17:56:20 26 4
gpt4 key购买 nike

实际上,我的网站用户在 mysql 数据库中存储了一些数据。接下来我想在excel文件中为用户导出这些数据,我可以完美地将数据导出到excel,但问题是mysql数据库中的unicode内容,当我尝试将unicode内容导出到EXCEL时,它显示如下:

 की इतने लिटर पानी के बाद आप कà¥

我正在使用 header 导出,代码如下:

header("Content-Type: application/xls");    
header("Content-Disposition: attachment; filename=$filename.xls");
header("Pragma: no-cache");
header("Expires: 0");

请帮我导出 Excel 文件中的 unicode 内容。提前致谢。

最佳答案

这看起来像天城文的“Mojibake”की इतने लिटर पानी के बाद आप क

参见Trouble with UTF-8 characters; what I see is not what I stored讨论 Mojibake 的起因。

可能是“双重编码”(也在该链接中讨论)。

utf8 中 कीHEXE0A495 E0A580;如果是双编码,则十六进制将为C3A0 C2A4 E280A2 C3A0 C2A5 E282AC

关于php - 使用 PHP 和 MySql 中的印地语 (Unicode) 内容将数据导出到 Excel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48784066/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com