Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ localedef(1) — Digital UNIX 3.2c

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

locale(1)

charmap(4)

locale(4)

localedef(1)  —  Commands

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

The localedef command processes locale and character map files to produce a locale database. 

FLAGS

-C compiler_options
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.

-cForces the creation of locale tables.  This flag must be used if you have received warning messages; otherwise, the locale tables will not be created. 

-f character_map
Specifies a file that maps character and collating symbols to actual character encodings. Using the -f flag allows one source definition to be applicable to more than one codeset.  If this flag is not specified, the Portable Character Set (PCS) is used.  This flag must be used if symbolic names (other than collating symbols defined in a collating-symbol keyword) are used. 

-i sourcefile
Specifies the pathname of a file containing the locale category source definitions.  If this flag is not present, source definitions are read from standard input.

-L linker_options
Passes the specified link options to the ld command used to build the locale. 

-m methodfile
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. 

-P tool_path
Prepends the specified path to the compiler and linker commands.

-vRuns the command in verbose mode to display information used for debugging. 

-wDisplays warnings when duplicate definitions are encountered. 

DESCRIPTION

The localedef command converts source files that contain definitions of the locale-dependent information (collation, date and time displays, character properties) into a run-time format, and assigns the definitions a locale name to be used with commands and functions that set the locale. 

The localename argument specifies the locale name for the source files that are being converted. The localename argument can be either a full pathname for the file location or a simple name indicating the locale name as located in the locale database. 

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. 

The character set mapping file, specified as the character_map argument, is described in the charmap file format reference page.  For information about localedef source files, see the locale file format reference page. 

A method file has the following format:

METHODS
method       entry [ package [ library_path ]]
END METHODS

The method file contains the following information:

methodThe name of the method. 

entryThe C function that implements the method.  This function is tailored to the locale’s codeset. 

packageThe optional package name for the shared library.  The package field is ignored; however, you must specify it if you specify library_path. 

library_path
The pathname of the shared-library or loadable object that contains the entry implementations. 

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. 

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        "__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"
END METHODS

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

Entries for methods other than the preceding ones are optional. 

EXAMPLES

     1.To create a locale called Austin from standard input and to disregard warnings, enter:

localedef -c Austin

     2.To create a locale called Austin from Austin.src as source input, enter:

localedef -i Austin.src Austin

NOTES

     1.If an error is detected, no permanent output is created. 

     2.If warnings occur, permanent output is created if the -c flag is specified.  The following conditions cause warning messages to be issued:

       •If a symbolic name not found in the charmap file is used for the descriptions of the LC_TYPE or LC_COLLATE categories (for other categories, this is an error condition). 

       •If the number of operands to the order keyword exceeds the COLL_WEIGHTS_MAX limit. 

       •If optional unsupported keywords are present in the source. 

EXIT VALUES

The localedef command returns the following exit values:

0No errors occurred and the locale(s) were successfully created. 

1Warnings occurred and the locale(s) were successfully created. 

2The locale specification exceeded limits or the coded character set(s) used are not supported, and no locale was created. 

3The capability to create new locales is not supported. 

>3Warnings or errors occurred and no output was created. 

RELATED INFORMATION

Commands: locale(1). 

Files:  charmap(4), locale(4). 

Writing Software for the International Market

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026