关于字符转码后输出的有关问题

WBOY
Release: 2016-06-13 13:42:45
Original
876 people have browsed it

关于字符转码后输出的问题
header("content-Type:text/plain;charset=gb2312");
header("Content-Disposition:attachment;filename=".date("YmdHis")."test.xls");
echo iconv("utf8","gb2312","微博ID\t");

为什么这样就导出的excel表格中时没有数据的呢?

将iconv函数中的utf8改写成utf-8,就没有问题了。

求解释原因,谢谢

------解决方案--------------------
utf8是mysql中utf8编码。php中的是utf-8.
------解决方案--------------------

探讨

引用:

1楼正解


但是在别人的机器上(ubantu),测试时没有问题的,在我的机器上(win7)就有问题了。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!