This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Fwd: Re: Update on libstdc++/6410 (a.k.a. non-ascii mon. symbolAND wchar_t => chaos)]
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: libstdc++ at gcc dot gnu dot org, Ulrich Drepper <drepper at redhat dot com>, bkoz<bkoz at redhat dot com>
- Date: Thu, 09 May 2002 13:16:17 +0200
- Subject: Re: [Fwd: Re: Update on libstdc++/6410 (a.k.a. non-ascii mon. symbolAND wchar_t => chaos)]
- References: <3CD98FE3.4030705@unitus.it>
>
>
>Then, looking at it in gdb:
>(gdb) p __ccurr
>$12 = 0x4003a0c5 "¤"
>(gdb) p *__ccurr
>$13 = -92 '¤'
>
>then...
>
>(gdb) p __wcs
>$14 = (wchar_t *) 0x80adc40
>(gdb) p *__wcs
>$15 = 8364
>
>both of these values are perhaps unexpected.
>
The first one, I don't find really unexpected, since casting it to
(unsigned char), we get 164, which is the correct code for the Euro
symbol, I'm told:
http://gcc.gnu.org/ml/libstdc++/2002-04/msg00236.html
http://gcc.gnu.org/ml/libstdc++/2002-04/msg00237.html
The latter, is /much/ more unexpected to me! Indeed, changing your
example to use the international monetary symbol (EUR), that is
__nl_langinfo_l(__INT_CURR_SYMBOL, __cloc) we get consistently:
(gdb) p *__ccurr
$1 = 69 'E'
(gdb) p *__wcs
$2 = 69
Why, for the non-ascii Euro symbol the wchar_t code is different from
that of the char counterpart?
Ciao,
Paolo.