diff options
Diffstat (limited to 'libjava/scripts')
-rw-r--r-- | libjava/scripts/encodings.pl | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libjava/scripts/encodings.pl b/libjava/scripts/encodings.pl index 5e802c1f5fc..9af10876985 100644 --- a/libjava/scripts/encodings.pl +++ b/libjava/scripts/encodings.pl @@ -8,7 +8,9 @@ 'ISO_8859-1:1987' => '8859_1', 'UTF-8' => 'UTF8', 'Shift_JIS' => 'SJIS', - 'Extended_UNIX_Code_Packed_Format_for_Japanese' => 'EUCJIS' + 'Extended_UNIX_Code_Packed_Format_for_Japanese' => 'EUCJIS', + 'UTF16-LE' => 'UnicodeLittle', + 'UTF16-BE' => 'UnicodeBig' ); if ($ARGV[0] eq '') @@ -25,6 +27,12 @@ else $file = $ARGV[0]; } +# Include canonical names in the output. +foreach $key (keys %map) +{ + $output{lc ($key)} = $map{$key}; +} + open (INPUT, "< $file") || die "couldn't open $file: $!"; $body = 0; @@ -50,17 +58,22 @@ while (<INPUT>) $current = $map{$name}; if ($current) { - print " hash.put (\"$lower\", \"$current\");\n"; + $output{$lower} = $current; } } elsif ($type eq 'Alias:') { # The IANA list has some ugliness. - if ($name ne '' && $name ne 'NONE' && $current) + if ($name ne '' && $lower ne 'none' && $current) { - print " hash.put (\"$lower\", \"$current\");\n"; + $output{$lower} = $current; } } } close (INPUT); + +foreach $key (sort keys %output) +{ + print " hash.put (\"$key\", \"$output{$key}\");\n"; +} |