Manual Page Result
0
Command: localedef | Section: 1 | Source: Digital UNIX | File: localedef.1.gz
localedef(1) General Commands Manual localedef(1)
NAME
localedef - Builds a locale from locale and character map source files
SYNOPSIS
localedef [-C compiler_options] [-c] [-f character_map] [-i sourcefile]
[-L linker_options] [-m methodfile] [-P tool_path] [-v] [-w] localename
STANDARDS
Interfaces documented on this reference page conform to industry stan-
dards as follows:
localedef: XPG4
Refer to the standards(5) reference page for more information about in-
dustry standards and associated tags.
OPTIONS
[DIGITAL] 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. This option
must be used if you have received warning messages; otherwise, the lo-
cale tables will not be created. Specifies a file that maps character
and collating symbols to actual character encodings. Using the -f op-
tion 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. For
more information about a character map file, see the charmap(4) refer-
ence page. Specifies the pathname of a file containing the locale cat-
egory source definitions. If this option is not present, source defin-
itions are read from standard input. For more information about source-
file, see the locale(4) reference page. [DIGITAL] Passes the speci-
fied link options to the ld command used to build the locale. [DIGI-
TAL] 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. [DIGITAL] Prepends the specified path to the com-
piler and linker commands. [DIGITAL] Runs the command in verbose mode
to display information used for debugging. [DIGITAL] Displays warn-
ings when duplicate definitions are encountered.
OPERANDS
Identifies the locale and determines where it will be built.
On DIGITAL UNIX systems, 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 privi-
leges, a locale can be moved after it is created.
When running the localedef command on other platforms, however,
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 automati-
cally created in the appropriate directory and may be the only
locales that system commands can access.
DESCRIPTION
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 as-
signs the definitions a locale name to be used with commands and func-
tions 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.
[DIGITAL] The localedef command can also process a file that specifies
how to build a methods library to be used by character- and string-con-
version functions when they operate in the locale environment. This
library is necessary for locales based on multibyte codesets, which re-
quire 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
[DIGITAL] The method file contains the following information: The name
of the method. The C function that implements the method. This func-
tion 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-li-
brary or loadable object that contains the entry implementations.
[DIGITAL] The package and library_path fields are optional. If not
specified, these fields default to libc and /usr/shlib/libc.so, respec-
tively. 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.
[DIGITAL] 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:
METHODS
__mbstopcs "__mbstopcs_sb" "libc" "/usr/shlib/libc.so"
__mbtopc "__mbtopc_sb" __pcstombs "__pcstombs_sb" __pctomb
"__pctomb_sb" mblen "__mblen_sb" mbstowcs "__mb-
stowcs_sb" mbtowc "__mbtowc_sb" wctomb "__wctomb_sb"
wcstombs "__wcstombs_sb" wcwidth "__wcwidth_latin" wc-
swidth "__wcswidth_latin"
fnmatch "__fnmatch_std" iswctype "__iswctype_std" lo-
caleconv "__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 "__wc-
scoll_std" wcsftime "__wcsftime_std" wcsxfrm "__wc-
sxfrm_std" wctype "__wctype_std"
END METHODS
[DIGITAL] 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
[DIGITAL] Entries for methods other than the preceding ones are op-
tional.
EXIT STATUS
The localedef command returns the following exit values: No errors oc-
curred 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.
ERRORS
To review localedef diagnostic messages, enter the following commands:
% cd /usr/lib/nls/msg/en_US.ISO8859-1 % dspcat localedef.cat | more
EXAMPLES
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: lo-
caledef -i Austin.src Austin
ENVIRONMENT VARIABLES
The following environment variables (see i18n_intro(5) and l10n_in-
tro(5)) affect execution of the localedef command: 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 se-
quences as characters in, for example, command parameters. Note that
the setting of this variable does not affect the processing of the in-
put source, for which the command always uses the POSIX locale. Speci-
fies the locale that determines which translations to use, if any ex-
ist, for the command's messages. Determines the search path that the
command uses to find message catalogs needed for processing LC_MES-
SAGES.
SEE ALSO
Commands: locale(1)
Files: charmap(4), locale(4)
Others: i18n_intro(5), iconv_intro(5), l10n_intro(5), standards(5)
Writing Software for the International Market
localedef(1)