|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-05-21 04:37 UTC] megaone at yandex dot ru
Description: ------------ ExtractTo cuts off non latin file names, no matter of codepage, til first space, so 'имя файла.txt' becomes ' файла.txt'. Filenames with no spaces gets cut off at all to extension only - '.txt'. getNameIndex returns full file names. Also ZipArchive relies on default_charset. When default_charset is different from archive charset, files will be unpacked with broken names. Problem appears on Ubuntu 12.04 with PHP 7.1.4 and with Debian 9 with PHP 7.0.16. First problem does not appear on Windows. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 04:00:01 2025 UTC |
I cannot reproduce the codepage-independency of this bug. Using Debian Bullseye (PHP 7.4.33): $ unzip -l zip.zip Archive: zip.zip Length Date Time Name --------- ---------- ----- ---- 0 2023-04-05 10:25 áéíuó.txt 0 2023-04-05 10:34 тест тест.txt --------- ------- 0 2 files $ cat zip.php <?php $zip = new ZipArchive; $zip->open('zip.zip'); $zip->extractTo('output/'); An ASCII locale is indeed broken: $ LANG=C php zip.php $ ls output/ uó.txt ' тест.txt' However, a UTF-8 locale works as expected: $ LANG=en_US.UTF-8 php zip.php $ ls output/ áéíuó.txt 'тест тест.txt'