Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ localedef(1) — Tru64 UNIX 4.0f

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Commands:  locale(1)

Files:  charmap(4)

locale(4)

Others:  i18n_intro(5)

iconv_intro(5)

l10n_intro(5)

standards(5)

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

STANDARDS

Interfaces documented on this reference page conform to industry standards as follows:

localedef:  XPG4

Refer to the standards(5) reference page for more information about industry standards and associated tags. 

OPTIONS

−C compiler_options
[Compaq]  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 option 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 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. For more information about a character map file, see the charmap(4) reference page. 

−i sourcefile
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. For more information about sourcefile, see the locale(4) reference page. 

−L linker_options
[Compaq]  Passes the specified link options to the ld command used to build the locale. 

−m methodfile
[Compaq]  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
[Compaq]  Prepends the specified path to the compiler and linker commands.

−v[Compaq]  Runs the command in verbose mode to display information used for debugging. 

−w[Compaq]  Displays warnings when duplicate definitions are encountered. 

OPERANDS

localename
Identifies the locale and determines where it will be built.

On Tru64 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 privileges, 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 automatically 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 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. 

[Compaq]  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

[Compaq]  The method file contains the following information:

method
The name of the method.

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

package
The 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. 

[Compaq]  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. 

[Compaq]  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

[Compaq]  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

[Compaq]  Entries for methods other than the preceding ones are optional. 

EXIT STATUS

The localedef command returns the following exit values:

0No errors occurred and the locale was successfully created. 

1Warnings occurred and the locale was successfully created. 

2The locale specification exceeded limits or the coded character set or sets being 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. 

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

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

localedef -c Austin

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

localedef -i Austin.src Austin

ENVIRONMENT VARIABLES

The following environment variables (see i18n_intro(5) and l10n_intro(5)) affect execution of the localedef command:

LANG
Provides a default value for the locale category variables that are not set.

LC_ALL
If set to a nonempty string value, overrides the values of all locale category variables and LANG. 

LC_CTYPE
Specifies the locale used to interpret byte sequences as characters in, for example, command parameters.  Note that the setting of this variable does not affect the processing of the input source, for which the command always uses the POSIX locale.

LC_MESSAGES
Specifies the locale that determines which translations to use, if any exist, for the command’s messages.

NLSPATH
Determines the search path that the command uses to find message catalogs needed for processing LC_MESSAGES. 

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

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