php下载内容为中文的文件时打开为乱码
下载的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);
?>
文件中的内容有中文是,下载下来打开后就是乱码。
大家帮忙啊,怎么解决。