From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28625 invoked by alias); 17 Apr 2009 23:50:10 -0000 Received: (qmail 28614 invoked by uid 22791); 17 Apr 2009 23:50:08 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Apr 2009 23:50:03 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3HNo1B9024691 for ; Fri, 17 Apr 2009 19:50:01 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3HNo0m2031142; Fri, 17 Apr 2009 19:50:01 -0400 Received: from opsy.redhat.com (vpn-12-137.rdu.redhat.com [10.11.12.137]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n3HNo0J6027854; Fri, 17 Apr 2009 19:50:00 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 7C5CB888034; Fri, 17 Apr 2009 17:49:59 -0600 (MDT) To: gdb-patches@sourceware.org Subject: FYI: fix Solaris problem with auto host charset From: Tom Tromey Reply-To: tromey@redhat.com Date: Fri, 17 Apr 2009 23:50:00 -0000 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00468.txt.bz2 I'm checking this in. On some versions of Solaris, nl_langinfo(CODESET) will return "646" for the C locale. Unfortunately, this value is not then recognized by iconv_open. This fixes the problem by recognizing this situation and using "ASCII" instead. I'm unaware of any other names needing this treatment. This is a bit of a hack. But, I think such cases should be rare. (My experience with gcj was that this was the only such case ever reported.) Built and regtested on x86-64 (compile farm). Joel also tested it on an actual Solaris box showing the problem, and reported improved test results. Tom 2009-04-17 Tom Tromey * charset.c (_initialize_charset): Add special case for "646". Index: charset.c =================================================================== RCS file: /cvs/src/src/gdb/charset.c,v retrieving revision 1.22 diff -u -r1.22 charset.c --- charset.c 15 Apr 2009 22:20:30 -0000 1.22 +++ charset.c 17 Apr 2009 23:45:32 -0000 @@ -817,6 +817,10 @@ #ifndef PHONY_ICONV #ifdef HAVE_LANGINFO_CODESET auto_host_charset_name = nl_langinfo (CODESET); + /* Solaris will return `646' here -- but the Solaris iconv then + does not accept this. */ + if (!strcmp (auto_host_charset_name, "646")) + auto_host_charset_name = "ASCII"; target_charset_name = auto_host_charset_name; set_be_le_names ();