This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fwd: Re: Update on libstdc++/6410 (a.k.a. non-ascii mon. symbolAND wchar_t => chaos)]


>
>
>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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]