summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/Encode/Encode.pm3
-rw-r--r--ext/Encode/bin/piconv15
-rw-r--r--ext/Encode/lib/Encode/Alias.pm2
3 files changed, 14 insertions, 6 deletions
diff --git a/ext/Encode/Encode.pm b/ext/Encode/Encode.pm
index a828d46d4c..0e89009114 100644
--- a/ext/Encode/Encode.pm
+++ b/ext/Encode/Encode.pm
@@ -57,7 +57,8 @@ sub encodings
}
my %modules = map {$_ => 1} @modules;
return
- sort grep {!/^(?:Internal|Unicode)$/o} keys %Encoding;
+ sort { lc $a cmp lc $b }
+ grep {!/^(?:Internal|Unicode)$/o} keys %Encoding;
}
sub define_encoding
diff --git a/ext/Encode/bin/piconv b/ext/Encode/bin/piconv
index 10cfb5e1f5..c375e19cdf 100644
--- a/ext/Encode/bin/piconv
+++ b/ext/Encode/bin/piconv
@@ -22,7 +22,7 @@ my $scheme = exists $Scheme{$Opt{S}} ? $Opt{S} : 'from_to';
if ($Opt{D}){
my $cfrom = Encode->getEncoding($from)->name;
my $cto = Encode->getEncoding($to)->name;
- print STDERR <<"EOT";
+ print <<"EOT";
Scheme: $scheme
From: $from => $cfrom
To: $to => $cto
@@ -51,7 +51,7 @@ if ($scheme eq 'from_to'){
}
sub list_encodings{
- print STDERR join("\n", Encode->encodings(":all")), "\n";
+ print join("\n", Encode->encodings(":all")), "\n";
exit;
}
@@ -63,7 +63,7 @@ sub help{
print STDERR <<"EOT";
$name [-f from_encoding] [-t to_encoding] [-s string] [files...]
$name -l
- -l lists all available encodings.
+ -l lists all available encodings (the canonical names, many aliases exist)
-f from_encoding When omitted, the current locale will be used.
-t to_encoding When omitted, the current locale will be used.
-s string "string" will be converted instead of STDIN.
@@ -114,7 +114,12 @@ uses I<string> instead of file for the source of text. Same as F<iconv>.
=item -l
-Lists all available encodings to STDERR.
+Lists all available encodings, one per line, in case-insensitive
+order. Note that only the canonical names are listed, many aliases
+exist. For example, the names are case-insensitive, and many standard
+and common aliases work, like "latin1" for "ISO 8859-1", or "ibm850"
+instead of "cp850", or "winlatin1" for "cp1252". See L<Encode::Supported>
+for the full discussion.
=item -h
@@ -155,6 +160,8 @@ Like I<-D> option, this is also for Encode hackers.
L<iconv(1)>
L<locale(3)>
L<Encode>
+L<Encode::Supported>
+L<Encode::Alias>
L<PerlIO>
=cut
diff --git a/ext/Encode/lib/Encode/Alias.pm b/ext/Encode/lib/Encode/Alias.pm
index dd7012f2a6..0c4b88449b 100644
--- a/ext/Encode/lib/Encode/Alias.pm
+++ b/ext/Encode/lib/Encode/Alias.pm
@@ -243,7 +243,7 @@ __END__
=head1 NAME
-Encode::Alias - alias defintions to encodings
+Encode::Alias - alias definitions to encodings
=head1 SYNOPSIS