This issue may be caused by differences in file name encoding. On Linux systems, UTF-8 encoding is typically used, whereas on Windows systems, GBK or UTF-16 encoding is commonly employed.
You can try the following methods to resolve this issue:
Convert the encoding of files downloaded within a PHP script to UTF-8; this ensures that Chinese file names are displayed correctly after the files are decompressed on Windows. You can use functions such as `iconv` or `mb_convert_encoding` to perform this encoding conversion.
When downloading a file, specify the UTF-8 encoding for the file name. In PHP, you can use the `urlencode` function to encode Chinese file names, and then specify this encoding during the download process; for example:
header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . urlencode($filename) . '"; filename*=utf-8\'\'' . urlencode($filename)); readfile($filepath);After downloading this file to Windows, the decompression tool will be able to correctly recognize Chinese file names.
- Install a decompression tool that supports UTF-8 encoding on Windows, such as 7-Zip. This ensures that the decompression tool can correctly identify Chinese filenames even when their encoding differs.
We hope these methods can help you solve your problem.