我的代码和摸板都是UTF-8,在程序总需要下载一个ASCII的文件,但下载下来文件的编码变成了UTF-8了,我要的结果是还是ASCII编码我的下载头是这样写的,没起作用:
*****************************************
header("Content-Transfer-Encoding: binary");
header("Content-type: application/vnd.ms-excel; charset=us-ascii");
header("Content-Disposition: attachment; filename=" . $file_name);
header("Content-length: " . $file_size);
*****************************************
在线等~~~~~~~~~~~~~`
*****************************************
header("Content-Transfer-Encoding: binary");
header("Content-type: application/vnd.ms-excel; charset=us-ascii");
header("Content-Disposition: attachment; filename=" . $file_name);
header("Content-length: " . $file_size);
*****************************************
在线等~~~~~~~~~~~~~`
utf8是兼容ascii的,(仅含ascii字符的utf8文件和ascii文件是一样的,无法区分的)
你为何说它是utf8而不是ascii的?如果是文件里含有非ascii字符,那么是文件内容的问题,不是编码本身的问题。