DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

localedef(1)


localedef -- define locale environment

Synopsis

localedef [-c] [-f charmap] [-i sourcefile] [name | -n]

Description

The localedef command converts source definitions for locale categories into a format usable by the functions and utilities whose operational behaviour is determined by the setting of the locale environment variables defined in ``Internationalization'' in Programming with system calls and libraries.

The command reads source definitions for one or more locale categories belonging to the same locale from the file named in the -i option (if specified) or from standard input. The name operand identifies the target locale. The localedef utility supports the creation of public, or generally accessible locales, as well as private, or restricted-access locales. Creation or modification of public locales is limited to users with the appropriate privileges.

Each category source definition is identified by the corresponding environment variable name and terminated by an END category-name statement. The following categories are supported.


LC_CTYPE
Defines character classification and case conversion.

LC_COLLATE
Defines collation rules.

LC_MONETARY
Defines the format and symbols used in formatting of monetary information.

LC_NUMERIC
Defines the decimal delimiter, grouping and grouping symbol for non-monetary numeric editing.

LC_TIME
Defines the format and content of date and time information.

LC_MESSAGES
Defines the format and values of affirmative and negative responses.

Options

The following options are supported:

-c
Create permanent output even if warning messages have been issued.

-f charmap
Specify the pathname of a file containing a mapping of character symbols and collating element symbols to actual character encodings. This option must be specified if symbolic names (other than collating symbols defined in a collating-symbol keyword) are used. See ``Files''. If the -f option is not present, the character mapping for the default C locale is used.

-i inputfile
The pathname of a file containing the source definitions. If this option is not present, source definitions will be read from standard input.

-n
Do not create output. This option is useful for debugging source definitions.

Operands

The name operand identifies the locale. If the name contains one or more slash characters, name will be interpreted as a pathname where the created locale definitions will be stored. If name does not contain any slash characters, the locale is created in /usr/lib/locale and the locale will be public. This capability is restricted to users with appropriate privileges. (As a consequence of specifying one name, although several categories can be processed in one execution, only categories belonging to the same locale can be processed.)

Input

Unless the -i option is specified, the standard input must be a text file containing one or more locale category source definitions. When lines are continued using the escape character mechanism, there is no limit to the length of the accumulated continued line.

Files

Locale information is kept in the directory /usr/lib/locale.

If a locale category source definition contains a copy statement, and the copy statement names a valid, existing locale, then localedef will behave as if the source definition had contained a valid category source definition for the named locale.

The character set mapping file specified as the charmap option-argument is described in X/Open Interface Definitions, Version 4 Issue 2, Section 4.4, Character Set Description File.

The character mapping mehcanism has been extended from the standard to more easily handle UTF and EUC encodings. Any of the following directives are accepted in the charmap file:

   <encoding>	none
   <encoding>	utf-8
   <encoding>	euc m1:d1,m2:d2,m3:d3
where the default is ``none'' for single-byte locales and ``utf-8'' for multibyte locales. If the encoding directive for ``utf-8'' is not included in the file, you can use ``\U''hhhh in a character definition to force UTF encoding for that character (replace hhhh with hexadecimal integers).

The third form of the directive must be specified for EUC encodings. In the third form, the arguments must specify the number of bytes in the multibyte sequence (not including the SS2 or SS3) and the display width; one set of values must be provided for each of codesets 1, 2, and 3.

Environment variables

The following environment variables affect the execution of locale:

LANG
Provide a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default C locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined.

LC_ALL
If set to a non-empty string value, override the values of all the other internationalization variables.

LC_CTYPE
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single as opposed to multi-byte characters in arguments).

LC_MESSAGES
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.

Output

The utility reports all categories successfully processed.

Exit codes

The following exit values are returned:

0
No errors occurred and the locales were successfully created.

1
Warnings occurred and the locales were successfully created.

2
The locale specification exceeded implementation limits or the coded character set or sets used are not supported; no locale was created.

3
The capability to create new locales is not supported.

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

Diagnostics

If an error is detected, no permanent output will be created. If warnings occur, permanent output will be created if the -c option was specified. The following conditions will cause warning messages to be issued:

Usage

The charmap definition is optional, and is contained outside the locale definition. This allows both completely self-defined source files, and generic sources (applicable to more than one codeset). To aid portability, all charmap definitions must use the same symbolic names for the portable character set.

References

locale(1), localedef(4)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004