From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3469 invoked by alias); 28 Aug 2009 00:58:11 -0000 Received: (qmail 3461 invoked by uid 22791); 28 Aug 2009 00:58:10 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Aug 2009 00:58:01 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7S0vxej020625 for ; Thu, 27 Aug 2009 20:57:59 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7S0vwHN030224; Thu, 27 Aug 2009 20:57:59 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7S0vv56006066; Thu, 27 Aug 2009 20:57:58 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 8ACBA3782A9; Thu, 27 Aug 2009 18:57:57 -0600 (MDT) From: Tom Tromey To: gdb-patches@sourceware.org Subject: Re: Iconv / Solaris References: <20090827020639.GA13935@caradoc.them.org> <20090827170851.GA25905@caradoc.them.org> <20090827203609.GA13388@caradoc.them.org> <20090827204258.GB13388@caradoc.them.org> Reply-To: tromey@redhat.com Date: Fri, 28 Aug 2009 01:01:00 -0000 In-Reply-To: <20090827204258.GB13388@caradoc.them.org> (Daniel Jacobowitz's message of "Thu, 27 Aug 2009 16:42:58 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (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-08/txt/msg00500.txt.bz2 >>>>> "Daniel" == Daniel Jacobowitz writes: Daniel> Maybe I'm thinking about this wrong... can we determine the Daniel> encoding of wchar_t somehow that works on Solaris? Something Daniel> like what we do now with nl_langinfo? Nope. For the "narrow" charset you can use nl_langinfo(CODESET). There is no equivalent for the wide charset :-( Many systems let you pass "wchar_t" to iconv_open, instead. However, Solaris doesn't. Daniel> Or is it not guaranteed to have any known encoding? If the system defines __STDC_ISO_10646__, then you know it uses Unicode. Otherwise, all bets are off. Daniel> I'm lost in the configure maze Yeah. The way it works: * If you have a fully working iconv + wchar_t suite, then: - All the gdb_* macros are defined as their wide counterparts, e.g. gdb_iswprint == iswprint The intermediate charset is wchar_t. * You might have iconv but no working wchar_t support. In this case we use the narrow forms for everything, e.g., gdb_iswprint == isprint (and gdb_wchar_t == char). However we still use iconv for recoding. The intermediate charset is host_charset. This is the scenario I propose we make Solaris use, preferably by using AC_TRY_RUN to test iconv_open. The impact on the user is that if he tries to print a string with non-host-charset characters, he will get escapes -- basically what GDB 6.8 does. * You might have nothing at all. This is the PHONY_ICONV case. In this scenario we use the narrow forms for everything and basically just fail unless host_charset == target_charset. Tom