From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22125 invoked by alias); 31 Oct 2005 19:41:26 -0000 Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org Received: (qmail 22076 invoked by uid 22791); 31 Oct 2005 19:41:21 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 31 Oct 2005 19:41:21 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j9VJfKqM028493 for ; Mon, 31 Oct 2005 14:41:20 -0500 Received: from opsy.redhat.com (vpn50-118.rdu.redhat.com [172.16.50.118]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j9VJfEV19878; Mon, 31 Oct 2005 14:41:14 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 2740F2DC151; Mon, 31 Oct 2005 12:34:35 -0700 (MST) To: Java Patch List Subject: Patch: FYI: PRs 14358, 24552 From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Mon, 31 Oct 2005 19:41:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-q4/txt/msg00144.txt.bz2 I'm checking this in on the 4.0 branch. I will put it on the trunk once it is open for bug fixes. This fixes PRs 14358 and 24552. It updates the encodings.pl script and regenerates the list of encoding aliases. It also adds a couple new hand-maintained aliases. Tom Index: ChangeLog from Tom Tromey PR libgcj/14358, libgcj/24552: * gnu/gcj/convert/IOConverter.java: Regenerate aliases. Add aliases for 'euc_jp' and 'eucjp'. * scripts/encodings.pl: Recognize 'none', not 'NONE'. Include canonical names in output. (%map): Added UnicodeLittle and UnicodeBig. Index: scripts/encodings.pl =================================================================== --- scripts/encodings.pl (revision 106281) +++ scripts/encodings.pl (working copy) @@ -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 @@ $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 @@ $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"; +} Index: gnu/gcj/convert/IOConverter.java =================================================================== --- gnu/gcj/convert/IOConverter.java (revision 106281) +++ gnu/gcj/convert/IOConverter.java (working copy) @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001 Free Software Foundation +/* Copyright (C) 2000, 2001, 2005 Free Software Foundation This file is part of libgcj. @@ -28,44 +28,53 @@ // canonical name. hash.put ("iso-latin-1", "8859_1"); hash.put ("iso8859_1", "8859_1"); + hash.put ("utf-16le", "UnicodeLittle"); + hash.put ("utf-16be", "UnicodeBig"); + // At least one build script out there uses 'utf8'. + hash.put ("utf8", "UTF8"); // On Solaris the default encoding, as returned by nl_langinfo(), // is `646' (aka ASCII), but the Solaris iconv_open() doesn't // understand that. We work around the problem by adding an // explicit alias for Solaris users. hash.put ("646", "ASCII"); + + // See PR 24552, PR 14358. + hash.put ("euc_jp", "EUCJIS"); + hash.put ("eucjp", "EUCJIS"); + // All aliases after this point are automatically generated by the // `encodings.pl' script. Run it to make any corrections. hash.put ("ansi_x3.4-1968", "ASCII"); - hash.put ("iso-ir-6", "ASCII"); hash.put ("ansi_x3.4-1986", "ASCII"); - hash.put ("iso_646.irv:1991", "ASCII"); hash.put ("ascii", "ASCII"); - hash.put ("iso646-us", "ASCII"); - hash.put ("us-ascii", "ASCII"); - hash.put ("us", "ASCII"); - hash.put ("ibm367", "ASCII"); hash.put ("cp367", "ASCII"); + hash.put ("cp819", "8859_1"); hash.put ("csascii", "ASCII"); - hash.put ("iso_8859-1:1987", "8859_1"); + hash.put ("cseucpkdfmtjapanese", "EUCJIS"); + hash.put ("csisolatin1", "8859_1"); + hash.put ("csshiftjis", "SJIS"); + hash.put ("euc-jp", "EUCJIS"); + hash.put ("extended_unix_code_packed_format_for_japanese", "EUCJIS"); + hash.put ("ibm367", "ASCII"); + hash.put ("ibm819", "8859_1"); + hash.put ("iso-8859-1", "8859_1"); hash.put ("iso-ir-100", "8859_1"); + hash.put ("iso-ir-6", "ASCII"); + hash.put ("iso646-us", "ASCII"); + hash.put ("iso_646.irv:1991", "ASCII"); hash.put ("iso_8859-1", "8859_1"); - hash.put ("iso-8859-1", "8859_1"); + hash.put ("iso_8859-1:1987", "8859_1"); + hash.put ("l1", "8859_1"); hash.put ("latin1", "8859_1"); - hash.put ("l1", "8859_1"); - hash.put ("ibm819", "8859_1"); - hash.put ("cp819", "8859_1"); - hash.put ("csisolatin1", "8859_1"); + hash.put ("ms_kanji", "SJIS"); + hash.put ("shift_jis", "SJIS"); + hash.put ("us", "ASCII"); + hash.put ("us-ascii", "ASCII"); hash.put ("utf-8", "UTF8"); - hash.put ("none", "UTF8"); - hash.put ("shift_jis", "SJIS"); - hash.put ("ms_kanji", "SJIS"); - hash.put ("csshiftjis", "SJIS"); - hash.put ("extended_unix_code_packed_format_for_japanese", "EUCJIS"); - hash.put ("cseucpkdfmtjapanese", "EUCJIS"); - hash.put ("euc-jp", "EUCJIS"); - hash.put ("euc-jp", "EUCJIS"); - hash.put ("utf-16le", "UnicodeLittle"); - hash.put ("utf-16be", "UnicodeBig"); + hash.put ("utf16-be", "UnicodeBig"); + hash.put ("utf16-le", "UnicodeLittle"); + // End script-generated section. + iconv_byte_swap = iconv_init (); }