www.LinuxHowtos.org





locale.gen

Section: File Formats (5)
Updated: January 2026
Index Return to Main Contents
 

NAME

locale.gen [em] configuration file for local-gen  

DESCRIPTION

The local-:gen(8) utility compiles the locales specified by the /etc/:locale.gen file and integrates them into a locale archive. The file is comprised of zero or more lines containing one or two fields separated by one or more <blank> characters. The first field defines the localename. The second field defines the charmap, also known as a character set or codeset. The <slash> character is forbidden within both fields. If only one field is specified, the charmap value shall be taken as "UT-8". Empty lines and lines beginning with zero or more <blank> characters followed by a <numbe-sign> character shall be ignored. A <numbe-sign> character surrounded by <blank> characters may appear after the second field and shall also be ignored, along with the remainder of the line. The definition of a <blank> character is that it is either the <tab> or <space> character. Consult the provided /usr/share/i18n/:SUPPORTED file for all valid combinations of the localename field and charmap field.  

LOCALE NAMES

A valid localename is of the following format:
language[_territory][.charmap][@modifier]
The complete list of supported language:[_territory]:[@modifier] values can be obtained by reading the first column of the /usr/share/i18n/:SUPPORTED file. The values map directly to the names of files within the /usr/share/i18n/:locales directory.  

CHARACTER MAPS

A charmap represents a mapping of character symbols and collating element symbols to actual character encodings that enables a standard way to decode, process, and encode text. The complete list of supported charmap values can be obtained by reading the second column of the /usr/share/i18n/:SUPPORTED file. The values map directly to the names of files within the /usr/share/i18n/:charmaps directory.  

EXAMPLES

# These three declarations are considered identical. en_US.UT-8 UT-8 # trailing comments are allowed en_US UT-8 # redundant charmap omitted en_US # charmap taken as UT-8

# Other charmaps may be specified (not recommended). en_US IS-885-1

# This localename/charmap combination is invalid. en_US GB2312  

FILES

/etc/locale.gen
The default location of the configuration file.
/usr/share/i18n/:SUPPORTED
A list of supported localename and charmap combinations.
/usr/share/i18n/:locales
Contains locale definition files that serve as inputs to localedef(1).
/usr/share/i18n/:charmaps
Contains character map files that serve as inputs to localedef(1).
 

SEE ALSO

local-gen(8), localectl(1), locale(1), localedef(1)  

STANDARDS

System Interface Definitions, Issue 4, Version 2 (XBD) (1994)
XPG-XPG4 Base Migration Guide, Version 2 (1995).
The Open Group Standard Base Specifications, Issue 8 (POSI-1.2024).

 

AUTHORS

Kerin Millar
Mike Frysinger
Alastair McKinstry


 

Index

NAME
DESCRIPTION
LOCALE NAMES
CHARACTER MAPS
EXAMPLES
FILES
SEE ALSO
STANDARDS
AUTHORS