On Oct 7 11:08, Andy Koppe wrote:
2009/10/7 Corinna Vinschen:
Urgh. So we have to change nl_langinfo in newlib as well. Do we have
to return "US-ASCII" if charset is "ASCII", or is it sufficient to
return __locale_charset() as you did, thus returning "ASCII" for "ASCII"?
I'd assume so, but WWLD?
===
#include <stdio.h>
#include <locale.h>
#include <langinfo.h>
int main ()
{
char *l;
setlocale (LC_ALL, "");
l = nl_langinfo (CODESET);
if (l)
printf ("%s\n", l);
return 0;
}
===
$ ./nll
ANSI_X3.4-1968
$ LANG=C.UTF-8 ./nll
ANSI_X3.4-1968
$ LANG=ja_JP ./nll
EUC-JP
$ LANG=ru_RU ./nll
ISO-8859-5
$ LANG=ru_UA ./nll
KOI8-U
$ LANG=zh_CN ./nll
GB2312
$ LANG=zh_TW ./nll
BIG5
Sigh. Do we really need a translation table?