php IE download garbled solution: first open the corresponding PHP file; then when the file name is output, convert the file name into gb2312 encoding, code such as "$name = iconv("utf-8", "gb2312",$name);".
Recommendation: "PHP Video Tutorial"
During website development, download files are often encountered function, certain requirements require the download file name to be in Chinese.
Generally, UTF-8 encoding is used when outputting Chinese, but some versions of IE browser do not use UTF-8 encoding when converting downloaded file names, resulting in garbled file names. The file download function named "Chinese.txt" was tested. The download in IE 11 browser is as follows:
On other browsers, such as chrome, Firefox and 360 have no problem:
#I tried it and converted the file name into gb2312 encoding when the file name was output. The problem was solved. The code is as follows :
$name = '中文.txt'; //转换文件名编码 $name = iconv("utf-8","gb2312",$name); Header("Content-Disposition: attachment; filename=".$name);
The screenshot of the effect is as follows:
The above is the detailed content of How to solve the problem of garbled download code in PHP IE. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version
Useful JavaScript development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Linux new version
SublimeText3 Linux latest version
