From: mitty Date: Sun, 10 Mar 2013 10:08:28 +0000 (+0000) Subject: * treat filename with unknown coding set as UTF-8 X-Git-Url: http://lab.mitty.jp/git/?a=commitdiff_plain;h=6eaca653364451b652023a6455e76af75a15c19b;p=lab.git * treat filename with unknown coding set as UTF-8 git-svn-id: https://lab.mitty.jp/svn/lab/trunk@204 7d2118f6-f56c-43e7-95a2-4bb3031d96e7 --- diff --git a/misc/save.pl b/misc/save.pl index 5c5a1db..77b6fb1 100755 --- a/misc/save.pl +++ b/misc/save.pl @@ -38,8 +38,16 @@ foreach my $url (@URLs) { $decoder->decode($filename), Encode::FB_HTMLCREF ); - print ": $filename\n"; } + else { + print "utf8?"; + $filename = encode( + $coding, + decode("utf8", $filename), + Encode::FB_HTMLCREF + ); + } + print ": $filename\n"; my $suffix = 1; my $savename = $filename;