解決UTF-8編碼VBB3附件下載名亂碼問題
開啟attachment.php文件,找到
PHP程式碼if ($extension != 'txt')
{
header("Content-disposition: inline; filename=\"$attachmentinfo[filename]\"");
header('Content-transfer-encoding: binary');
}
else
{
// force txt files to be downloaded because of a possible XSS issue
header("Content-disposition: attachment; filename=\"$attachmentinfo[filename]\"");
}
在前面加上
PHP程式碼$cmd = "echo '$attachmentinfo[filename]' | iconv -f UTF-8 -t GB2312";
$attachmentinfo[filename] = shell_exec($cmd);
也就是將$attachmentinfo[filename]從UTF-8轉成GB2312,若是您的PHP有 iconv模組則更加方便,直接用函數就成:),我的空間沒有
下面請大家幫進行測試,看是否正常
做完系統後沒有安裝Firefox,請朋友們在Firefox下試試
|