[RFH] Which is the value of __nl_langinfo_l(__CURRENCY_SYMBOL, loc) for xx_XX@euro locales?
Paolo Carlini
pcarlini@unitus.it
Sat Apr 20 09:46:00 GMT 2002
Hi all,
I'm working on tweaking libstdc++-v3 testsuite to work well with the new
EURO localedata and I'm puzzled about the following testcase:
#define _GNU_SOURCE 1
#include <locale.h>
#include <langinfo.h>
int main()
{
__locale_t loc;
char* _M_curr_symbol;
const char* __s = "de_DE@euro";
loc = __newlocale(1 << LC_ALL, __s, 0);
_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, loc);
/* _M_curr_symbol == \244 */
__freelocale(loc);
return 0;
}
On my i686-pc-linux-gnu, glibc2.2.5 I get _M_curr_symbol equal to a single char, octal \244, when using xx_XX@euro localedata (and asking for the local, vs international, symbol).
I'm really triggering an "undefined behavior" or does in fact make sense asking for a local monetary symbol of a xx_XX@euro locale, and \244 is part of a standard specification??
Thank,
Paolo.
More information about the Libc-alpha
mailing list