This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[RFH] Which is the value of __nl_langinfo_l(__CURRENCY_SYMBOL, loc)for xx_XX@euro locales?
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: libc-alpha at sources dot redhat dot com
- Cc: libstdc++ at gcc dot gnu dot org, drepper at redhat dot com
- Date: Sat, 20 Apr 2002 14:52:58 +0200
- Subject: [RFH] Which is the value of __nl_langinfo_l(__CURRENCY_SYMBOL, loc)for xx_XX@euro locales?
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.