Subject: Re: iconv and conversion from/to local charset and wchar_t
To: Noriyuki Soda <soda@sra.co.jp>
From: Dave Huang <khym@azeotrope.org>
List: tech-userlevel
Date: 01/30/2004 09:44:11
On Sat, Jan 31, 2004 at 12:04:35AM +0900, Noriyuki Soda wrote:
> I don't think you need the runtime check, because nl_langinfo(CODESET)
> should work on all systems, including Linux, NetBSD and other
> commercial UNIX variants.
> The "" and "char" are GNU specific extension to iconv_open(3),
> and this extension isn't really essential, because nl_langinfo(CODESET)
> does same thing with portable way.

I don't think nl_langinfo(CODESET) is portable--as far as I can tell,
there's no standard for either the codeset names returned by
nl_langinfo, or the acceptable codesets for iconv. I ran into a
problem with an older version of scmxx (see
<http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=20017>) where
NetBSD's nl_langinfo(CODESET) would return "646" for ASCII and
"ISO8859-1" for ISO 8859-1.  However, GNU iconv was looking for
"ASCII" or "ISO646-US" for ASCII, and "ISO-8859-1" for ISO 8859-1.
-- 
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 28 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++