Bug #71034 [NEW]: Can't add UTF-8 filenames as UTF-8 to ZIP archive
From: slavikca at gmail dot com
Operating system: Ubuntu 14.04
PHP version: 5.6.16
Package: Zip Related
Bug Type: Bug
Bug description:Can't add UTF-8 filenames as UTF-8 to ZIP archive
Description:
------------
*Steps to reproduce*
- use ZipArchive to archive file, which has UTF-8 characters in it.
Test script:
---------------
<?php
$zip = new ZipArchive();
if ($zip->open("test.zip", ZIPARCHIVE::CREATE) !== true)
die ("Failed to create archive");
if (!$zip->addFile("/var/www/test/web/ÑеÑÑ123")) //here are UTF-8
characters in the filename
print ("Failure adding file");
$zip->close();
Expected result:
----------------
the name of archived file will be stored as UTF-8
Actual result:
--------------
file successfully archived. But it's names stored not in UTF-8.
To see, if filename was stored au UTF-8 or not, you can use "-U" option
in unzip utility:
Here is output for archive created in PHP:
# unzip -l -U test.zip
...
/var/www/test/web/ÑеÑÑ123
Here is output for archive created by linux zip utility:
# unzip -l -U test2.zip
...
/var/www/test/web/#U0442#U0435#U0441#U0442123
--
Edit bug report at https://bugs.php.net/bug.php?id=71034&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71034&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71034&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71034&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71034&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71034&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71034&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71034&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71034&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71034&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71034&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71034&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71034&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71034&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71034&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71034&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71034&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71034&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71034&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71034&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71034&r=mysqlcfg
Thread (11 messages)
- slavikca at gmail dot com
- slavikca at gmail dot comBug #71034 [Com]: Can't add UTF-8 filenames as UTF-8 to ZIP archive
- ab@php.netBug #71034 [Opn->Fbk]: Can't add UTF-8 filenames as UTF-8 to ZIP archive
- slavikca at gmail dot comBug #71034 [Com]: Can't add UTF-8 filenames as UTF-8 to ZIP archive
- slavikca at gmail dot comBug #71034 [Com]: Can't add UTF-8 filenames as UTF-8 to ZIP archive
- ab@php.netBug #71034 [Fbk->Nab]: Can't add UTF-8 filenames as UTF-8 to ZIP archive
- ab@php.netBug #71034 [Nab]: Can't add UTF-8 filenames as UTF-8 to ZIP archive
- slavikca at gmail dot comBug #71034 [Nab]: Can't add UTF-8 filenames as UTF-8 to ZIP archive
- slavikca at gmail dot comBug #71034 [Nab]: Can't add UTF-8 filenames as UTF-8 to ZIP archive
- ab@php.netBug #71034 [Nab]: Can't add UTF-8 filenames as UTF-8 to ZIP archive
- slavikca at gmail dot comBug #71034 [Nab]: Can't add UTF-8 filenames as UTF-8 to ZIP archive