Bug #53948 [Com]: ZIP archive UTF-8 filenames problem

From: Date: Mon, 30 May 2011 06:49:24 +0000
Subject: Bug #53948 [Com]: ZIP archive UTF-8 filenames problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-161044@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53948&edit=1

 ID:                 53948
 Comment by:         mikhail dot v dot gavrilov at gmail dot com
 Reported by:        asaf at lingnu dot com
 Summary:            ZIP archive UTF-8 filenames problem
 Status:             Duplicate
 Type:               Bug
 Package:            Zip Related
 Operating System:   linux
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

I also confirm this problem.

Workaround: Helps converting to your DOS encoding.


Previous Comments:
------------------------------------------------------------------------
[2011-02-18 14:02:20] pajoye@php.net

#51929

------------------------------------------------------------------------
[2011-02-07 14:06:39] asaf at lingnu dot com

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 this bug report at http://bugs.php.net/bug.php?id=53948&edit=1


Thread (17 messages)

« previous php.bugs (#161044) next »