From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10936 invoked by alias); 16 Jan 2009 00:53:26 -0000 Received: (qmail 10922 invoked by uid 22791); 16 Jan 2009 00:53:25 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_55,KAM_MX,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, 16 Jan 2009 00:52:50 +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 n0G0omJf004934; Thu, 15 Jan 2009 19:50:48 -0500 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 n0G0omQU023066; Thu, 15 Jan 2009 19:50:48 -0500 Received: from opsy.redhat.com (vpn-13-28.rdu.redhat.com [10.11.13.28]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n0G0olgX030511; Thu, 15 Jan 2009 19:50:47 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 8FAF237813B; Thu, 15 Jan 2009 17:50:45 -0700 (MST) To: Julian Brown Cc: gdb-patches@sourceware.org Subject: Re: [PATCH/WIP] C/C++ wchar_t/Unicode printing support References: <20090115202411.5f154657@rex.config> <20090115221523.28c15971@rex.config> From: Tom Tromey Reply-To: Tom Tromey Date: Fri, 16 Jan 2009 00:53:00 -0000 In-Reply-To: <20090115221523.28c15971@rex.config> (Julian Brown's message of "Thu\, 15 Jan 2009 22\:15\:23 +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-01/txt/msg00368.txt.bz2 >>>>> "Julian" == Julian Brown writes: Tom> Perhaps we can invoke "iconv -l" at startup... eww. Julian> I ran into this problem too. An earlier version of my patch Julian> had this, in register_iconv_charsets(): [...] Julian> ...which isn't quite right, but can maybe be adapted into something Julian> which is. Nice. GNU libiconv has the iconvlist function... I wish this were portable. I suppose we could try that, then popen(iconv -l), and then fall back to some built-in list. Tom> Another difference is that I have the intermediate step go through the Tom> host wchar_t rather than UCS-4. This is nice because it means we can Tom> use iswprint to decide if something is printable. But, it may have Tom> limitations, I suppose, on a host where wchar_t is less capable. Julian> I think that might break for recent win32, where wchar_t is Julian> UTF-16 (i.e. more than one wide character may be needed for a Julian> given code point). I think my current code ought to work ok in this case, assuming that w32's iswprint returns false for surrogate characters. In this case we'll just emit escape codes. This area is still not ideal, though. In particular, my current code only works on hosts that define __STDC_ISO_10646__. Does w32 define this? Hmm, I just thought of a way we can perhaps do better. I will look at this a little more. Tom