Linux - locale (LANG, LC environment variable)

About

Most UNIX systems use the LANG variable to specify the desired locale but you can use also the setlocale function.

Articles Related

How to

Obtain the locale values

To obtain the locale names for your UNIX system, enter the following:

locale -a
[powercenter@di-obia-01 ~]$ locale -a | grep -i en
en_AU
en_AU.iso88591
en_AU.utf8
en_BW
en_BW.iso88591
en_BW.utf8
en_CA
en_CA.iso88591
en_CA.utf8
en_DK
en_DK.iso88591
en_DK.utf8
en_GB
en_GB.iso88591
en_GB.iso885915
en_GB.utf8
en_HK
en_HK.iso88591
en_HK.utf8
en_IE
en_IE@euro
en_IE.iso88591
en_IE.iso885915@euro
en_IE.utf8
en_IN
en_IN.utf8
en_NZ
en_NZ.iso88591
en_NZ.utf8
en_PH
en_PH.iso88591
en_PH.utf8
en_SG
en_SG.iso88591
en_SG.utf8
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8
en_ZA
en_ZA.iso88591
en_ZA.utf8
en_ZW
en_ZW.iso88591
en_ZW.utf8

Obtain the locale values

When invoked without arguments, locale summarizes the current locale environment for each locale category defined by the LC_* environment variables.

[powercenter@di-obia-01 ~]$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Set a locale

With the setlocale function

setlocale

Documentation / Reference

  • Bookmark "Linux - locale (LANG, LC environment variable)" at del.icio.us
  • Bookmark "Linux - locale (LANG, LC environment variable)" at Digg
  • Bookmark "Linux - locale (LANG, LC environment variable)" at Ask
  • Bookmark "Linux - locale (LANG, LC environment variable)" at Google
  • Bookmark "Linux - locale (LANG, LC environment variable)" at StumbleUpon
  • Bookmark "Linux - locale (LANG, LC environment variable)" at Technorati
  • Bookmark "Linux - locale (LANG, LC environment variable)" at Live Bookmarks
  • Bookmark "Linux - locale (LANG, LC environment variable)" at Yahoo! Myweb
  • Bookmark "Linux - locale (LANG, LC environment variable)" at Facebook
  • Bookmark "Linux - locale (LANG, LC environment variable)" at Yahoo! Bookmarks
  • Bookmark "Linux - locale (LANG, LC environment variable)" at Twitter
  • Bookmark "Linux - locale (LANG, LC environment variable)" at myAOL
 
linux/locale.txt · Last modified: 2011/06/18 13:36 by gerardnico