From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1611 invoked by alias); 27 Aug 2009 20:30:42 -0000 Received: (qmail 1602 invoked by uid 22791); 27 Aug 2009 20:30:41 -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; Thu, 27 Aug 2009 20:30:34 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7RKUWjT015703 for ; Thu, 27 Aug 2009 16:30:32 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7RKUVab015605; Thu, 27 Aug 2009 16:30:31 -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 n7RKUU0V029324; Thu, 27 Aug 2009 16:30:31 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 48ECE3782A9; Thu, 27 Aug 2009 14:30:30 -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> Reply-To: tromey@redhat.com Date: Thu, 27 Aug 2009 20:36:00 -0000 In-Reply-To: <20090827170851.GA25905@caradoc.them.org> (Daniel Jacobowitz's message of "Thu, 27 Aug 2009 13:08:51 -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/msg00491.txt.bz2 >>>>> "Daniel" == Daniel Jacobowitz writes: Daniel> On Thu, Aug 27, 2009 at 11:00:41AM -0600, Tom Tromey wrote: >> Alternatively, you could try using the __sun__ variant and running gdb >> in a non-UTF-8 locale. If it works we could go with (a variant of) this >> approach. Daniel> What do we look for? That is, how would I know if it was working or Daniel> not? I can easily try an ISO-8859-1 locale, but otherwise I'm a bit Daniel> out of my depth. Hmm, good question. For ISO-8859-1, it is tricky, because that is a subset of UCS-4. I think you could do a test in other ISO-8859 locales: take a narrow character not appearing in ISO-8859-1, convert it to a wchar_t using btowc, and then print the value. If the value is the same as the UCS-4 value, you probably have UCS-4 wchar_t. E.g., in ISO-8859-15, 0xA4 is the euro currency sign. In UCS-4 this is 0x20A0. The cases I was more concerned about were locales using encodings like SJIS or EUC. I'm not sure what wchar_t encoding these might use. So, I dug through the OpenSolaris source a little and I think UCS-4 is not always used. In particular it looks like mbtowc can call: http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libbc/libc/gen/common/euc.multibyte.c#_mbtowc_euc ... which looks like it uses an ad hoc flattened EUC encoding. The initial problem here is that iconv will not accept "wchar_t" as an encoding on this platform. I see we only have one AC_TRY_RUN in gdb ... am I right in assuming that these are not ok? If they are ok, we can test this at configure time. If they are not ok, I think we can just add a new setting to configure.host. This is simpler to implement. Tom