From 6eaca653364451b652023a6455e76af75a15c19b Mon Sep 17 00:00:00 2001 From: mitty Date: Sun, 10 Mar 2013 10:08:28 +0000 Subject: [PATCH] * 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 --- misc/save.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; -- 1.7.9.5