From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18433 invoked by alias); 14 Apr 2006 13:01:07 -0000 Received: (qmail 18420 invoked by uid 22791); 14 Apr 2006 13:01:06 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Apr 2006 13:01:05 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1FUNuv-0007Nu-9Z for gdb@sources.redhat.com; Fri, 14 Apr 2006 17:00:58 +0400 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1FUNuZ-0007Bi-G1; Fri, 14 Apr 2006 17:00:31 +0400 From: Vladimir Prus To: Eli Zaretskii Subject: Re: printing wchar_t* Date: Fri, 14 Apr 2006 13:06:00 -0000 User-Agent: KMail/1.7.2 Cc: gdb@sources.redhat.com References: <200604141246.58094.ghost@cs.msu.su> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604141700.30020.ghost@cs.msu.su> 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/msg00179.txt.bz2 On Friday 14 April 2006 16:55, Eli Zaretskii wrote: > > 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? I'd say, any software using std::wstring on Linux. > Anyway, UTF-16 is a variable-length encoding, so wchar_t is not it. Since C++ standard says nothing about encoding of wchar_t, specific application can do anything it likes. In particular, I believe that on Windows, wchar_t* is assumed to be in UTF-16 encoding. > > > 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? Yes, that would be sufficient for me. - Volodya