Bug #53948 [NEW]: ZIP archive UTF-8 filenames problem
From:
Operating system: linux
PHP version: 5.3.5
Package: Zip Related
Bug Type: Bug
Bug description:ZIP archive UTF-8 filenames problem
Description:
------------
when creating zip archive with non-english filenames,
the filenames are not encoded correctly, upon extraction
you get them like ???_???.txt.
(tested with various unzipping software on windows/linux)
a suggested workaround, e.g:
$zip->addFile($file_data['path'],
iconv("UTF-8","CP852",$file_name));
doesn't help
Test script:
---------------
<?php
$zip = new ZipArchive();
if ($zip->open('/tmp/test.zip', ZIPARCHIVE::CREATE) === TRUE) {
$zip->addFile('/tmp/file.txt', '×§×××¥.txt');
$zip->close();
echo "done";
} else {
echo "failed";
}
?>
Expected result:
----------------
create a zip file which can be extracted reproducing the original file
names.
Actual result:
--------------
non english file names comes out corrupted, e.g: ???_???.txt
--
Edit bug report at http://bugs.php.net/bug.php?id=53948&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53948&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53948&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53948&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53948&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53948&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53948&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53948&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53948&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53948&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53948&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53948&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53948&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53948&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53948&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53948&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53948&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53948&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53948&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53948&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53948&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53948&r=mysqlcfg
Thread (17 messages)
- asaf at lingnu dot com
- pajoye@php.netBug #53948 [Opn->Dup]: ZIP archive UTF-8 filenames problem
- mikhail dot v dot gavrilov at gmail dot comBug #53948 [Com]: ZIP archive UTF-8 filenames problem
- killerloin at yahoo dot comBug #53948 [Com]: ZIP archive UTF-8 filenames problem
- robert at softcom dot noBug #53948 [Com]: ZIP archive UTF-8 filenames problem
- nadavkav at gmail dot comBug #53948 [Com]: ZIP archive UTF-8 filenames problem
- animelp at yahoo dot com dot arBug #53948 [Com]: ZIP archive UTF-8 filenames problem
- pajoye@php.netBug #53948 [Dup]: ZIP archive UTF-8 filenames problem
- domnulnopcea at gmail dot comBug #53948 [Com]: ZIP archive UTF-8 filenames problem
- danhab2000 at yahoo dot comBug #53948 [Com]: ZIP archive UTF-8 filenames problem
- danhab2000 at yahoo dot comBug #53948 [Com]: ZIP archive UTF-8 filenames problem
- pajoye@php.netBug #53948 [Dup]: ZIP archive UTF-8 filenames problem
- allan dot mascarenhas1987 at gmail dot comBug #53948 [Com]: ZIP archive UTF-8 filenames problem
- requinix@php.netBug #53948 [Dup]: ZIP archive UTF-8 filenames problem
- allan dot mascarenhas1987 at gmail dot comBug #53948 [Com]: ZIP archive UTF-8 filenames problem
- 1710ef4e at opayq dot comBug #53948 [Com]: ZIP archive UTF-8 filenames problem
- 498936940 at qq dot comBug #53948 [Com]: ZIP archive UTF-8 filenames problem