From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16934 invoked by alias); 18 Apr 2009 06:38:50 -0000 Received: (qmail 16925 invoked by uid 22791); 18 Apr 2009 06:38:50 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout7.012.net.il (HELO mtaout7.012.net.il) (84.95.2.19) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 18 Apr 2009 06:38:45 +0000 Received: from conversion-daemon.i-mtaout7.012.net.il by i-mtaout7.012.net.il (HyperSendmail v2007.08) id <0KIA00F00A261K00@i-mtaout7.012.net.il> for gdb-patches@sourceware.org; Sat, 18 Apr 2009 09:38:42 +0300 (IDT) Received: from HOME-C4E4A596F7 ([77.124.144.191]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KIA00HEJAGGIJ00@i-mtaout7.012.net.il>; Sat, 18 Apr 2009 09:38:41 +0300 (IDT) Date: Sat, 18 Apr 2009 06:38:00 -0000 From: Eli Zaretskii Subject: Re: FYI: fix Solaris problem with auto host charset In-reply-to: To: tromey@redhat.com Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83y6tyihzh.fsf@gnu.org> References: X-IsSubscribed: yes 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/msg00476.txt.bz2 > From: Tom Tromey > Date: Fri, 17 Apr 2009 17:49:58 -0600 > > 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. Btw, why is the code assuming that nl_langinfo always returns a meaningful result? It can potentially return an empty string. Although this is at worst a very rare situation, perhaps we should take it into consideration and fall back on GDB_DEFAULT_HOST_CHARSET. Also, I don't quite get the reason why nl_langinfo is not called in the PHONY_ICONV case. It seems we blindly assume the native charset is Latin-1 in that case, but perhaps nl_langinfo, if it exists, will give a better guess?