From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7230 invoked by alias); 14 Apr 2006 12:56:11 -0000 Received: (qmail 7222 invoked by uid 22791); 14 Apr 2006 12:56:10 -0000 X-Spam-Check-By: sourceware.org Received: from nitzan.inter.net.il (HELO nitzan.inter.net.il) (192.114.186.20) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Apr 2006 12:56:09 +0000 Received: from HOME-C4E4A596F7 (IGLD-83-130-214-179.inter.net.il [83.130.214.179]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id DDF88550 (AUTH halo1); Fri, 14 Apr 2006 15:56:00 +0300 (IDT) Date: Fri, 14 Apr 2006 13:05:00 -0000 Message-Id: From: Eli Zaretskii To: Vladimir Prus CC: gdb@sources.redhat.com In-reply-to: <200604141246.58094.ghost@cs.msu.su> (message from Vladimir Prus on Fri, 14 Apr 2006 12:46:57 +0400) Subject: Re: printing wchar_t* Reply-to: Eli Zaretskii References: <200604141246.58094.ghost@cs.msu.su> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00178.txt.bz2 > From: Vladimir Prus > Date: Fri, 14 Apr 2006 12:46:57 +0400 > Cc: gdb@sources.redhat.com > > No, I meant UTF-16 encoding (the one with surrogate pairs), and UTF-32 > encoding (which does exists, in the Unicode standard). What software uses that? Anyway, UTF-16 is a variable-length encoding, so wchar_t is not it. > > For example, in command-line version of GDB, if the terminal supports > > UTF-8 encoded characters, that function would output a UTF-8 encoding > > of the non-ASCII string, and then the terminal will display them with > > the correct glyphs. > > This is non-starter. I can't have debuggee send data to KDevelop widgets. That was just an example. I know it's irrelevant to your case (and, in fact, to any GUI front-end). > > A wchar_t string is just an array, and GDB already has a feature to > > produce N elements of an array. In CLI, you say "print *array@20" to > > print the first 20 elements of the named array. > > I don't know how many elements there are, as wchar_t* is zero terminated, so > I'd like gdb to compute the length automatically. That's easy. Assuming that is done, is it all you need?