Checking the locale configuration on UNIX platforms

On UNIX™ systems, the locale command without parameters outputs information about the current locale environment.

Once the LANG environment variable is set, check that the locale environment is correct:
$ export LANG=en_US.ISO8859-1
$ locale 
LANG=en_US.ISO8859-1 
LC_CTYPE="en_US.ISO8859-1" 
LC_NUMERIC="en_US.ISO8859-1" 
LC_TIME="en_US.ISO8859-1" 
LC_COLLATE="en_US.ISO8859-1" 
LC_MONETARY="en_US.ISO8859-1" 
LC_MESSAGES="en_US.ISO8859-1" 
LC_PAPER="en_US.ISO8859-1" 
LC_NAME="en_US.ISO8859-1" 
LC_ADDRESS="en_US.ISO8859-1" 
LC_TELEPHONE="en_US.ISO8859-1" 
LC_MEASUREMENT="en_US.ISO8859-1" 
LC_IDENTIFICATION="en_US.ISO8859-1" 
LC_ALL=

If the locale environment is not correct, then it is recommended that you check the value of the following environment variables: LC_ALL, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, etc.

The following examples show the effect of LC_ALL and LC_CTYPE on locale configuration. The LC_ALL variable overrides all other LC_.... environment variables.
$ export LANG=en_US.ISO8859-1
$ export LC_ALL=POSIX
$ export LC_CTYPE=fr_FR.ISO8859-15
$ locale 
LANG=en_US.ISO8859-1 
LC_CTYPE="POSIX" 
LC_NUMERIC="POSIX" 
LC_TIME="POSIX" 
LC_COLLATE="POSIX" 
LC_MONETARY="POSIX" 
LC_MESSAGES="POSIX" 
LC_PAPER="POSIX" 
LC_NAME="POSIX" 
LC_ADDRESS="POSIX" 
LC_TELEPHONE="POSIX" 
LC_MEASUREMENT="POSIX" 
LC_IDENTIFICATION="POSIX" 
LC_ALL=POSIX
$ fglrun -i mbcs 
LANG honored: yes 
Charmap     : ANSI_X3.4-1968 
Multibyte   : no 
Stateless   : yes

The charset used is the ASCII charset. Clearing the LC_ALL environment variable produces the following output. Note the LC_CTYPE value:

$ unset LC_ALL
$ locale 
LANG=en_US.ISO8859-1
LC_CTYPE=fr_FR.ISO8859-15
LC_NUMERIC="en_US.ISO8859-1" 
LC_TIME="en_US.ISO8859-1" 
LC_COLLATE="en_US.ISO8859-1" 
LC_MONETARY="en_US.ISO8859-1" 
LC_MESSAGES="en_US.ISO8859-1" 
LC_PAPER="en_US.ISO8859-1" 
LC_NAME="en_US.ISO8859-1" 
LC_ADDRESS="en_US.ISO8859-1" 
LC_TELEPHONE="en_US.ISO8859-1" 
LC_MEASUREMENT="en_US.ISO8859-1" 
LC_IDENTIFICATION="en_US.ISO8859-1" 
LC_ALL=
$ fglrun -i mbcs 
Error: locale not supported by C library, check LANG.
$ locale charmap 
ANSI_X3.4-1968
After clearing the LC_ALL value, the value of the variable LC_CTYPE is used. It appears that it is not correct. After clearing this value we get the following output:
$ unset LC_CTYPE
$ locale 
LANG=en_US.ISO8859-1 
LC_CTYPE="en_US.ISO8859-1" 
LC_NUMERIC="en_US.ISO8859-1" 
LC_TIME="en_US.ISO8859-1" 
LC_COLLATE="en_US.ISO8859-1" 
LC_MONETARY="en_US.ISO8859-1" 
LC_MESSAGES="en_US.ISO8859-1" 
LC_PAPER="en_US.ISO8859-1" 
LC_NAME="en_US.ISO8859-1" 
LC_ADDRESS="en_US.ISO8859-1" 
LC_TELEPHONE="en_US.ISO8859-1" 
LC_MEASUREMENT="en_US.ISO8859-1" 
LC_IDENTIFICATION="en_US.ISO8859-1" 
LC_ALL=
$ locale charmap 
ISO-8859-1
$ fglrun -i mbcs 
LANG honored: yes 
Charmap     : ISO-8859-1 
Multibyte   : no 
Stateless   : yes