localedef - Builds a locale from locale and character map
localedef [-C compiler_options] [-c] [-f character_map]
[-i sourcefile] [-L linker_options] [-m methodfile]
[-P tool_path] [-v] [-w] localename
Interfaces documented on this reference page conform to
industry standards as follows:
See standards(5) for more information about industry standards
and associated tags.
[Tru64 UNIX] Passes the specified options to the compiler
that builds the locale. If you are specifying more than
one option, enclose the list in double quotes. Forces the
creation of locale tables. You must use this option if
you have received warning messages; otherwise, the locale
tables will not be created. Specifies a file that maps
character and collating symbols to actual character encodings.
Using the -f option allows one source definition to
be applicable to more than one codeset. If this option is
not specified, the Portable Character Set (PCS) is used.
The -f option must be used if symbolic names (other than
collating symbols defined in a collating-symbol keyword)
are used. See charmap(4) for more information about a
character map file. Specifies the pathname of a file containing
the locale category source definitions. If this
option is not present, source definitions are read from
standard input. See locale(4) for more information about
sourcefile. [Tru64 UNIX] Passes the specified link
options to the ld command used to build the locale.
[Tru64 UNIX] Specifies the name of a method file that
describes which methods are to be overridden when constructing
a locale. The localedef command reads the
method file and uses the entry points when constructing
the locale objects. The codeset methods specified are
also used in parsing the charmap file. [Tru64
UNIX] Prepends the specified path to the compiler and
linker commands. [Tru64 UNIX] Runs the command in verbose
mode to display information used for debugging.
[Tru64 UNIX] Displays warnings when duplicate definitions
Identifies the locale and determines where it will be
[Tru64 UNIX] Locales can be moved after they are
created and the presence or absence of slash (/)
characters in localename does not indicate whether
a locale is later treated as public or private. The
default directory for public locales is
/usr/lib/nls/loc, to which, assuming the appropriate
privileges, a locale can be moved after it is
When running the localedef command on other operating
systems, you may have to omit slash (/) characters
from localename when creating a public locale
and include them only when creating a private
locale. On these platforms, public locales are
automatically created in the appropriate directory
and may be the only locales that system commands
Because a number of changes have been made to
locales to enable support for the latest version of
the Unicode standard (see Unicode(5)), locales you
generate on Tru64 UNIX Version 5.1B and later may
not work under earlier versions of Tru64 UNIX. However,
locales you generate on earlier versions of
Tru64 UNIX will work under Version 5.1B.
The localedef command converts source files that contain
definitions of the locale-dependent information (collation,
date-and-time displays, and character properties)
into a run-time format. The command then assigns the definitions
a locale name to be used with commands and functions
that set the locale.
If a locale category source definition contains a copy
statement and the statement names a valid existing locale
that is installed in the system, localedef behaves as if
the source definition had contained a valid category
source definition for the named locale.
[Tru64 UNIX] The localedef command can also process a
file that specifies how to build a methods library to be
used by character- and string-conversion functions when
they operate in the locale environment. This library is
necessary for locales based on multibyte codesets, which
require conversion methods that are different from the
default methods used by C library routines. A method file
has the following format:
METHODS method entry[package[library_path]] END METHODS
[Tru64 UNIX] The method file contains the following
information: The name of the method. The C function that
implements the method. This function is tailored to the
locale's codeset. The optional package name for the
shared library. The package field is ignored; however, you
must specify it if you specify library_path. The pathname
of the shared-library or loadable object that contains the
[Tru64 UNIX] The package and library_path fields are
optional. If not specified, these fields default to libc
and /usr/shlib/libc.so, respectively. The localedef command
retains the last value specified for both of these
fields, so you need to specify these values only once to
override the default for the entire methods file.
[Tru64 UNIX] The following example of a methods file
lists all of the valid values for the method field in the
first column, along with the default entry, package, and
pathname values that are used with single-byte locales
other than the POSIX locale:
__mbstopcs "__mbstopcs_sb" "libc"
"/usr/shlib/libc.so" __mbtopc "__mbtopc_sb"
__pcstombs "__pcstombs_sb" __pctomb
"__pctomb_sb" mblen "__mblen_sb" mbstowcs
"__mbstowcs_sb" mbtowc "__mbtowc_sb" wctomb
"__wctomb_sb" wcstombs "__wcstombs_sb" wcwidth
"__wcwidth_latin" wcswidth "__wcswidth_latin"
fnmatch "__fnmatch_std" iswctype "__iswctype_std"
localeconv "__localeconv_std" nl_langinfo
"__nl_langinfo_std" regcomp "__regcomp_std"
regexec "__regexec_std" regfree
"__regfree_std" rpmatch "__rpmatch_std" regerror
"__regerror_std" towupper "__towupper_std" towlower
"__towlower_std" strcoll "__strcoll_std" strfmon
"__strfmon_std" strftime "__strftime_std" strptime
"__strptime_std" strxfrm "__strxfrm_std" wcscoll
"__wcscoll_std" wcsftime "__wcsftime_std" wcsxfrm
"__wcsxfrm_std" wctype "__wctype_std"
[Tru64 UNIX] If you supply a methods file for your
locale, the file must contain entries for the following
methods because, without them, it is not possible to read
the charmap file:
__mbstopcs __mbtopc __pcstombs __pctomb mblen mbstowcs
mbtowc wcstombs wcswidth wctomb wcwidth
[Tru64 UNIX] Entries for methods other than the preceding
ones are optional.
The localedef command returns the following exit values:
No errors occurred and the locale was successfully created.
Warnings occurred and the locale was successfully
created. The locale specification exceeded limits or the
coded character set or sets being used are not supported,
and no locale was created. The capability to create new
locales is not supported. Warnings or errors occurred and
no output was created.
If an error occurs on execution of the localedef command,
it does not create an output file.
If warnings occur, the command creates an output file only
if the -c option is specified. The following conditions
cause warning messages to be issued: A symbolic name not
found in the charmap file was used for the descriptions of
the LC_TYPE or LC_COLLATE categories. (For other categories,
this condition is treated as an error.) The number
of operands to the order keyword exceeds the
COLL_WEIGHTS_MAX limit. Optional but unsupported keywords
are present in the source input.
[Tru64 UNIX] To review localedef diagnostic messages,
enter the following commands: % cd
/usr/lib/nls/msg/en_US.ISO8859-1 % dspcat localedef.cat |
To create a locale called Austin from standard input and
to disregard warnings, enter the following: localedef -c
Austin To create a locale called Austin from Austin.src as
source input, enter the following: localedef -i Austin.src
ENVIRONMENT VARIABLES [Toc] [Back]
The following environment variables affect execution of
the localedef command. See i18n_intro(5) and l10n_intro(5)
for more information. Provides a default value for the
locale category variables that are not set. If set to a
nonempty string value, overrides the values of all locale
category variables and LANG. Specifies the locale used to
interpret byte sequences as characters in, for example,
command parameters. The setting of this variable does not
affect the processing of the input source, for which the
command always uses the POSIX locale. Specifies the
locale that determines which translations to use, if any
exist, for the command's messages. Determines the search
path that the command uses to find message catalogs needed
for processing LC_MESSAGES.
Files: charmap(4), locale(4)
Others: i18n_intro(5), iconv_intro(5), l10n_intro(5),
Writing Software for the International Market
[ Back ]