[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] character sets and localization

From: Peter Maydell
Subject: Re: [Nmh-workers] character sets and localization
Date: Sat, 13 Nov 2010 21:46:52 +0000

Earl Hood wrote:
>On Sat, Nov 13, 2010 at 11:50 AM, Jon Steinhart <address@hidden> wrote:
>>> Look at the $LANG environment variable, that's probably a good start on most
>>> systems. The various LC_ environment variables if you want to do more
>>> localization work.
>> That's the way it is on my Linux system but that doesn't make it standard.

>  printf("%s\n", nl_langinfo(CODESET));

Yes. Note that we already use this in nmh -- see get_charset() in
sbr/check_charset.c, for instance. [I'm not sure if the documentation
got updated -- lots of it still just mentions MM_CHARSET, and I don't
know if that's because some code still only deals with MM_CHARSET and
doesn't honour locale, or if we just didn't change the docs.]

We also already use iconv() for some things if the system has it -- see

Both these are in my opinion the Right Way to handle charsets (they are
both POSIX); the only question is how much effort you want to go to to
support fallback options for systems which don't implement them. At
the moment we have ifdeffery for both these; I don't know whether the
code paths for "not supported" get much testing...

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]