localedef(C)


localedef -- define locale environment

Syntax

localedef [ -b ] [ -c ] [ -f charmap ] [ -i sourcefile ] name

Description

localedef converts source definitions for locale categories into a format usable by commands and library routines that depend on the values of locale environment variables for their behavior.

localedef expects to read source definitions for several locale categories on the standard input unless a sourcefile is defined with the -i option.

The output files are placed into the locale name.

The following categories can be defined:


LC_COLLATE
Collation order used by commands such as sort(C) and uniq(C). localedef places the output in the file collate.

LC_CTYPE
Character classification and case conversion. localedef places the output in the file ctype.

LC_MESSAGES
Formats of informative and diagnostic messages and interactive responses. localedef places the output in the file messages.

LC_MONETARY
Monetary formatting. localedef places the output in the file currency.

LC_NUMERIC
Numeric, non-monetary formatting. localedef places the output in the file numeric.

LC_TIME
Date and time formats. localedef places the output in the file time.
localedef takes the following options:

-b
This option suppresses backward compatibility warning messages. These messages are generated when information specified by the sourcefile cannot be represented in the backward compatibility portion of the binary representation.

-c
This option creates permanent output even if warning messages are produced by the command. Warning messages can be caused by implementation-dependent conditions such as an optional keyword not supported by the implementation being present in the source, or the number of operands to the order keyword exceeds the limit defined by the {COLL_WEIGHTS_MAX} variable. (See getconf(C) for information on variables.)

-f charmap
charmap contains a mapping of character symbols and collating element symbols to actual character encodings. Use this option if symbolic names are used instead of collating symbols.

-i sourcefile
sourcefile contains the source definitions for the locale categories. Each entry begins with the environment variable name and ends with an END environment variable name statement. If this option is not present, input is taken from standard input.
If the name of a locale contains one or more slash characters, it will be interpreted as a pathname where the locale definitions (ctype, time and so on) will be located. If name does not contain a slash character, the location of the created definitions will be implementation dependent; the locale itself will be public.

Exit values

localedef returns one of the following values:

0
successful completion of command

1
warnings occurred, but the command successfully completed

2
the locale specification exceeded system limits, or the coded character set(s) are not supported: no locale was created

> 3
warnings or errors occurred, and the locale was not created

Examples

In this example, a locale definition for the Gaelic language in Scotland is being created (the ISO 8859-1 codeset is specified):

localedef -c -f chrmap.src -i locdef.src /usr/lib/lang/gd/GB/ISO8859-1

localedef reads chrmap.src for the character mapping details, and locdef.src for the source definitions. The resulting category definitions are placed in the directory /usr/lib/lang/gd/GB/ISO8859-1. The directories in the pathname must exist prior to the command being run.

See also

chrconv(M), chrtbl(M), colconv(M), coltbl(M), environ(M), locale(C), locale(M), localedef(F), mesconv(M), mestbl(M), monconv(M), montbl(M), numconv(M), numtbl(M), timconv(M), timtbl(M)

Standards conformance

localedef is conformant with:

ISO/IEC DIS 9945-2:1992, Information technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities (IEEE Std 1003.2-1992);
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005