Skip to content

Instantly share code, notes, and snippets.

@kanonji
Created May 30, 2013 20:31
Show Gist options
  • Save kanonji/5680939 to your computer and use it in GitHub Desktop.
Save kanonji/5680939 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use Archive::Zip;
use Encode;
if (@ARGV == 0) {
die "usage: $0 ZIPFILE\n";
}
for (@ARGV) {
my $zipfile = $_;
if (! -e $zipfile) {
die "$zipfile don't exist\n";
}
my $zip=Archive::Zip->new($zipfile);
my @items = $zip->memberNames();
my $utf8name;
foreach (@items) {
my $utf8name = $_;
Encode::from_to($utf8name, 'cp932', 'utf-8');
print "extract : $utf8name\n";
$zip->extractMember($_, $utf8name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment