[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] Deprecating MM_CHARSET
From: |
Ken Hornstein |
Subject: |
Re: [Nmh-workers] Deprecating MM_CHARSET |
Date: |
Sun, 19 Jan 2014 18:24:22 -0500 |
>> I am wondering if we can assume that nl_langinfo() exists on all
>> platforms that we care about. It's part of POSIX. I ask because if
>> it doesn't exist I'm not sure how we get the current character set.
>> My feeling is in this day and age we should assume it exists.
>
>I would assume a locale of "C" in the absence of ml_langinfo(). That's
>the default locale if there are no $LANG or $LC_* definitions in scope,
>and the behaviour is intended to be backwards compatible with the
>pre-locale UNIX behaviour.
So nl_langinfo(CODESET) returns "US-ASCII" if we're in the C locale. That
seems ... sub-optimal, and wrong, if it doesn't exist. Also, IS there a
platform we care about where nl_langinfo() doesn't exist?
--Ken