projects
/
lab.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
utils::get gives hashref tree from API
[lab.git]
/
misc
/
save.pl
diff --git
a/misc/save.pl
b/misc/save.pl
index
6b673a8
..
77b6fb1
100755
(executable)
--- a/
misc/save.pl
+++ b/
misc/save.pl
@@
-13,7
+13,6
@@
my $target = shift @ARGV || die "$0: URL or file-of-url-list [coding]\n";
my $coding = shift @ARGV || 'utf8';
my $ua = LWP::UserAgent->new;
my $coding = shift @ARGV || 'utf8';
my $ua = LWP::UserAgent->new;
-my $enc = find_encoding($coding);
my @URLs;
if ($target !~ /^http/ && -f $target) {
my @URLs;
if ($target !~ /^http/ && -f $target) {
@@
-33,8
+32,22
@@
foreach my $url (@URLs) {
my $filename = $res->filename;
my $decoder = Encode::Guess->guess($filename);
if (ref($decoder)) {
my $filename = $res->filename;
my $decoder = Encode::Guess->guess($filename);
if (ref($decoder)) {
- $filename = $enc->encode($decoder->decode($filename));
+ print $decoder->name;
+ $filename = encode(
+ $coding,
+ $decoder->decode($filename),
+ Encode::FB_HTMLCREF
+ );
}
}
+ else {
+ print "utf8?";
+ $filename = encode(
+ $coding,
+ decode("utf8", $filename),
+ Encode::FB_HTMLCREF
+ );
+ }
+ print ": $filename\n";
my $suffix = 1;
my $savename = $filename;
my $suffix = 1;
my $savename = $filename;