International Language Environments Guide for Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

C Locale

The C locale, also known as the POSIX locale, is the default system locale for all POSIX-compliant systems. The Oracle Solaris operating system is a POSIX system. The Single UNIX Specification, Version 3, defines the C locale. You can register at http://www.unix.org/version3/online.html to read and download the specification.

You can specify your internationalized programs to run in the C locale in the following two ways:

  • Unset all locale environment variables. Runs the application in the C locale.

    $ unset LC_ALL LANG LC_CTYPE LC_COLLATE LC_NUMERIC LC_TIME LC_MONETARY LC_MESSAGES
  • Explicitly set the locale to C or POSIX.

    $ export LC_ALL=C
    $ export LANG=C

    Some applications check the LANG environment variables without actually calling setlocale(3C) to reference the current locale. In this case, shell is explicitly set to the C locale by specifying the LC_ALL and LANG locale environment variables. For the precedence relationship among locale environment variables, see the setlocale(3C) man page.

To check the current locale settings in a terminal environment, run the locale(1) command.

$ locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=