http://qs1969.pair.com?node_id=1113230


in reply to Seeking help with Extracting files from zip

Everything works perfectly as long as my zip file has files named with Latin characters, but things get worse when the names are Chinese or Japanese.

If you can answer a couple of questions, it may give us the information that would allow us to actually help you...

Oh, one other thing: the following code works for me (Perl 5.10.1, debian oldstable amd64):

nathan@warthog:~/test2/extract$ ls somefile.zip nathan@warthog:~/test2/extract$ perl -e ' $filename = "somefile.zip"; $dest_dir = "/home/nathan/test2/extract"; use Archive::Zip; my $zip = Archive::Zip->new(); local $Archive::Zip::UNICODE = 1; unless ( $zip->read($filename) == AZ_OK ) { die "Error Reading Zip File !"; } foreach my $m ($zip->members()) { print "Member $m:\n "; my $err = $zip->extractMemberWithoutPaths( $m, "$dest_dir/" . $m->fi +leName); print "Error: $err" if $err; print $/; }' Member Archive::Zip::ZipFileMember=HASH(0xdfdd30): Member Archive::Zip::ZipFileMember=HASH(0xdfe2b8): Member Archive::Zip::ZipFileMember=HASH(0xdfe5a0): Member Archive::Zip::ZipFileMember=HASH(0xdfe888): Member Archive::Zip::ZipFileMember=HASH(0xdfeb98): Member Archive::Zip::ZipFileMember=HASH(0xdfee80): nathan@warthog:~/test2/extract$ ls 한국어 somefile.zip ગુજર&# +2750;તી ಕನ್ನಡ ব&#24 +94;ংলা 中文 日本語 nathan@warthog:~/test2/extract$
(Perlmonks seems unable or perhaps unwilling to handle most of those characters -- and if unwilling I can't blame them; this is by design an English-language venue -- but they display just fine on my terminal when I do the ls. Of course, I created my somefile.zip using the zip program that comes with Debian; yours may have been created using different software...)