Subject: Return from nl_langinfo(CODESET)--any standard?
To: None <tech-userlevel@netbsd.org>
From: Dave Huang <khym@azeotrope.org>
List: tech-userlevel
Date: 01/24/2003 15:10:53
Yesterday, I ran into a program that assumes that the output of
nl_langinfo(CODESET) is a name that (GNU) libiconv recognizes. This
doesn't seem like an unreasonable assumption to me--I did a quick
search through SUSv3 and didn't come up with anything that specified
what nl_langinfo(CODESET) was supposed to return. SUSv3 does say that
iconv_open() codeset names are implementation-defined.

So, is there any reason why our nl_langinfo() doesn't return an 
"official" name, such as one from 
http://www.iana.org/assignments/character-sets ?  GNU iconv supports 
the IANA names... right now, nl_langinfo() returns "646" for an ASCII 
locale, rather than "ASCII", "US-ASCII", "ISO646-US", or some other 
common variant. For ISO 8859-x locales, nl_langinfo() returns 
"ISO8859-x", rather than "ISO-8859-x".
-- 
Name: Dave Huang         |  Mammal, mammal / their names are called /
INet: khym@azeotrope.org |  they raise a paw / the bat, the cat /
FurryMUCK: Dahan         |  dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 27 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++