LOCALE(1)

NAME
 - Get locale-specific information.

SYNOPSIS
locale [-amsuUvh]
locale [-ck] NAME

OPTIONS

-a, --all-locales
    List all available supported locales

-c, --category-name
    List information about given category NAME

-k, --keyword-name
    Print information about given keyword NAME

-m, --charmaps
    List all available character maps

-s, --system
    Print system default locale

-u, --user
    Print user's default locale

-U, --utf
    Attach ".UTF-8" to the result

-v, --verbose
    More verbose output

-h, --help
    This text

DESCRIPTION
 locale without parameters prints information about the current locale environment settings.

The -u option prints the current user's Windows default locale to stdout. The -s option prints the systems default locale instead. With the -U option locale appends a ".UTF-8". This can be used in scripts to set the Cygwin locale to the Windows user or system default, for instance:

bash$ export LANG=$(locale -uU)
bash$ echo $LANG
en_US.UTF-8

The -a option is helpful to learn which locales are supported by your Windows machine. It prints all available locales and the allowed modifiers. Example:

bash$ locale -a
C
C.utf8
POSIX
af_ZA
af_ZA.utf8
am_ET
am_ET.utf8
be_BY
be_BY.utf8
be_BY@latin
ca_ES
ca_ES.utf8
ca_ES@euro
catalan

The -v option prints more detailed information about each available locale. Example:

bash$ locale -av
locale: af_ZA archive: /cygdrive/c/Windows/system32/kernel32.dll
-------------------------------------------------------------------------------
 language | Afrikaans
territory | South Africa
  codeset | ISO-8859-1
locale: af_ZA.utf8 archive: /cygdrive/c/Windows/system32/kernel32.dll
-------------------------------------------------------------------------------
 language | Afrikaans
territory | South Africa
  codeset | UTF-8
locale: ca_ES@euro archive: /mnt/c/Windows/system32/kernel32.dll
-------------------------------------------------------------------------------
 language | Catalan
territory | Spain
  codeset | ISO-8859-15
locale: catalan archive: /usr/share/locale/locale.alias
-------------------------------------------------------------------------------
 language | Catalan
territory | Spain
  codeset | ISO-8859-1

The -m option prints the names of the available charmaps supported by Cygwin to stdout.

Otherwise, if arguments are given, locale prints the values assigned to these arguments. Arguments can be names of locale categories (for instance: LC_CTYPE, LC_MONETARY), or names of keywords supported in the locale categories (for instance: thousands_sep, charmap). The -c option prints additionally the name of the category. The -k option prints additionally the name of the keyword. Example:

bash$ locale -ck LC_MESSAGES
LC_MESSAGES
yesexpr="^[yY]"
noexpr="^[nN]"
yesstr="yes"
nostr="no"
messages-codeset="UTF-8"
bash$ locale noexpr
^[nN]

COPYRIGHT
Cygwin is Copyright (C) 1995-2010 Red Hat, Inc.

Cygwin is Free software; for complete licensing information, refer to: http://cygwin.com/licensing.html

SEE ALSO
The full documentation to the Cygwin API is maintained on the web at: http://cygwin.com/cygwin-api/cygwin-api.html The website is updated more frequently than the man pages and should be considered the authoritative source of information.