下载的php代码
<?php
$FilePath=iconv("UTF-8", "GB2312", $FilePath);
header('Content-Type: text/html; charset=utf-8');
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".basename($FilePath));
header("Content-Transfer-Encoding: binary");
readfile($FilePath);
?>
文件中的内容有中文是,下载下来打开后就是乱码。大家帮忙啊,怎么解决。
<?php
$FilePath=iconv("UTF-8", "GB2312", $FilePath);
header('Content-Type: text/html; charset=utf-8');
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".basename($FilePath));
header("Content-Transfer-Encoding: binary");
readfile($FilePath);
?>
文件中的内容有中文是,下载下来打开后就是乱码。大家帮忙啊,怎么解决。
我要是下载utf-8的文件打开就不是乱码的。我现在想要的就是打开不是乱码。能在php中作处理啊
说到底是你的PHP编辑器设置了默认UTF8编码,其他编码当然乱码。