Edit report at http://bugs.php.net/bug.php?id=51929&edit=1

 ID:                 51929
 Comment by:         g dot faust at tarent dot de
 Reported by:        kgo_yoi at hotmail dot com
 Summary:            Extracted a zip file that contains a folder named
                     with Chinese characters
 Status:             Open
 Type:               Bug
 Package:            Zip Related
 Operating System:   Windows XP Simplified Chinese
 PHP Version:        5.2.13
 Block user comment: N
 Private report:     N

 New Comment:

Like Bug #53948 (ZIP archive UTF-8 filenames problem) the problem seems
to be the zip-implementation which (seems to) expects CP437 as valid
encoding for file-/foldernames.



using 



$newFileOrFoldername = iconv('UTF-8', 'CP437//IGNORE//TRANSLIT',
$oldFileOrFoldername);



as a Workaround, you have to look that iconv() supports CP437.

After this Workaround it works* with Win7(64bit) and Ubuntu 10.4(64bit)
but the Archivemanager under Ubuntu 10.4(32bit) still shows wrong
characters.



*) With the converted Filename where characters not-matching CP437 will
be transliterated or even ignored - so it may be not a Workaround for
Chinese characters ...


Previous Comments:
------------------------------------------------------------------------
[2010-05-27 13:36:22] kgo_yoi at hotmail dot com

Description:
------------
Extracted a zip file contains a folder named with Chinese characters,
the files in the folder is no longer in it.



e.g.

I have 2 zips, the one named en.zip contains a folder named English



en.zip

     |- English

           |- en.txt





the other named zh.zip contains a folder named 中文



zh.zip

     |- 中文

         |- zh.txt





Then I use ZipArchive to extract them,





Test script:
---------------
<?php

$zip = new ZipArchive;



$zip->open('en.zip');

$zip->extractTo('.');

$zip->close();



$zip->open('zh.zip');

$zip->extractTo('.');

$zip->close();

Expected result:
----------------
There are 2 folders, 'English' and '中文', each folder contains a txt
file.

Actual result:
--------------
The 'English' folder contains a txt file named en.txt; the '中文'
folder is empty and zh.txt is out of it.


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51929&edit=1

Reply via email to