nmh-workers
[Top][All Lists]
Advanced

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

Re: [Nmh-workers] mhshow: unable to convert character set of...


From: Ralph Corderoy
Subject: Re: [Nmh-workers] mhshow: unable to convert character set of...
Date: Fri, 06 Feb 2015 15:54:22 +0000

Hi,

Norm wrote:
> Under Linux, setting the Locale is tricky, because setting several
> different environment variables effectively sets the Locale. I had
> that problem due to a decade's old setting that I had long since
> forgotten. David Levine found the problem. I could never have found it
> myself. To this day, I don't know the reason for the ancient setting.

locale(1) shows the locale in use based on its environment.

    $ locale
    LANG=en_GB.utf8
    LANGUAGE=
    LC_CTYPE="en_GB.utf8"
    LC_NUMERIC="en_GB.utf8"
    LC_TIME="en_GB.utf8"
    LC_COLLATE="en_GB.utf8"
    LC_MONETARY="en_GB.utf8"
    LC_MESSAGES="en_GB.utf8"
    LC_PAPER="en_GB.utf8"
    LC_NAME="en_GB.utf8"
    LC_ADDRESS="en_GB.utf8"
    LC_TELEPHONE="en_GB.utf8"
    LC_MEASUREMENT="en_GB.utf8"
    LC_IDENTIFICATION="en_GB.utf8"
    LC_ALL=
    $

They're not all simply the values of the matching environment variables.
To see what variables are affecting its output, trace the calls to
library routine getenv(3).

    $ ltrace -e getenv locale
    getenv("LC_ALL")                  = NULL
    getenv("LANGUAGE")                = NULL
    getenv("LANG")                    = "en_GB.utf8"
    LANG=en_GB.utf8
    getenv("POSIXLY_CORRECT")         = NULL
    LANGUAGE=
    getenv("LC_CTYPE")                = NULL
    LC_CTYPE="en_GB.utf8"
    getenv("LC_NUMERIC")              = NULL
    LC_NUMERIC="en_GB.utf8"
    getenv("LC_TIME")                 = NULL
    LC_TIME="en_GB.utf8"
    getenv("LC_COLLATE")              = NULL
    LC_COLLATE="en_GB.utf8"
    getenv("LC_MONETARY")             = NULL
    LC_MONETARY="en_GB.utf8"
    getenv("LC_MESSAGES")             = NULL
    LC_MESSAGES="en_GB.utf8"
    getenv("LC_PAPER")                = NULL
    LC_PAPER="en_GB.utf8"
    getenv("LC_NAME")                 = NULL
    LC_NAME="en_GB.utf8"
    getenv("LC_ADDRESS")              = NULL
    LC_ADDRESS="en_GB.utf8"
    getenv("LC_TELEPHONE")            = NULL
    LC_TELEPHONE="en_GB.utf8"
    getenv("LC_MEASUREMENT")          = NULL
    LC_MEASUREMENT="en_GB.utf8"
    getenv("LC_IDENTIFICATION")       = NULL
    LC_IDENTIFICATION="en_GB.utf8"
    LC_ALL=
    +++ exited (status 0) +++
    $

This shows that for me, only $LANG is affecting a program's locale.

Cheers, Ralph.



reply via email to

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