LOCALEDEF(1POSIX) | POSIX Programmer's Manual | LOCALEDEF(1POSIX) |
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
localedef — define locale environment
localedef [-c] [-f charmap] [-i sourcefile] [-u code_set_name] name
The localedef utility shall convert source definitions for locale categories into a format usable by the functions and utilities whose operational behavior is determined by the setting of the locale environment variables defined in the Base Definitions volume of POSIX.1‐2017, Chapter 7, Locale. It is implementation-defined whether users have the capability to create new locales, in addition to those supplied by the implementation. If the symbolic constant POSIX2_LOCALEDEF is defined, the system supports the creation of new locales. On XSI-conformant systems, the symbolic constant POSIX2_LOCALEDEF shall be defined.
The utility shall read 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 utility shall support the creation of public, or generally accessible locales, as well as private, or restricted-access locales. Implementations may restrict the capability to create or modify public locales to users with appropriate privileges.
Each category source definition shall be identified by the corresponding environment variable name and terminated by an END category-name statement. The following categories shall be supported. In addition, the input may contain source for implementation-defined categories.
The localedef utility shall conform to the Base Definitions volume of POSIX.1‐2017, Section 12.2, Utility Syntax Guidelines.
The following options shall be supported:
The following operand shall be supported:
Unless the -i option is specified, the standard input shall be a text file containing one or more locale category source definitions, as described in the Base Definitions volume of POSIX.1‐2017, Section 7.3, Locale Definition. When lines are continued using the escape character mechanism, there is no limit to the length of the accumulated continued line.
The character set mapping file specified as the charmap option-argument is described in the Base Definitions volume of POSIX.1‐2017, Section 6.4, Character Set Description File. If a locale category source definition contains a copy statement, as defined in the Base Definitions volume of POSIX.1‐2017, Chapter 7, Locale, and the copy statement names a valid, existing locale, then localedef shall behave as if the source definition had contained a valid category source definition for the named locale.
The following environment variables shall affect the execution of localedef:
Default.
The utility shall report all categories successfully processed, in an unspecified format.
The standard error shall be used only for diagnostic messages.
The format of the created output is unspecified. If the name operand does not contain a <slash>, the existence of an output file for the locale is unspecified.
When the -u option is used, the code_set_name option-argument shall be interpreted as an implementation-defined name of a codeset to which the ISO/IEC 10646‐1:2000 standard position constant values shall be converted via an implementation-defined method. Both the ISO/IEC 10646‐1:2000 standard position constant values and other formats (decimal, hexadecimal, or octal) shall be valid as encoding values within the charmap file. The codeset represented by the implementation-defined name can be any codeset that is supported by the implementation.
When conflicts occur between the charmap specification of <code_set_name>, <mb_cur_max>, or <mb_cur_min> and the implementation-defined interpretation of these respective items for the codeset represented by the -u option-argument code_set_name, the result is unspecified.
When conflicts occur between the charmap encoding values specified for symbolic names of characters of the portable character set and the implementation-defined assignment of character encoding values, the result is unspecified.
If a non-printable character in the charmap has a width specified that is not -1, the result will be undefined.
The following exit values shall be returned:
If an error is detected, no permanent output shall be created.
If warnings occur, permanent output shall be created if the -c option was specified. The following conditions shall cause warning messages to be issued:
Other implementation-defined conditions may also cause warnings.
The following sections are informative.
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. As explained in the Base Definitions volume of POSIX.1‐2017, Section 6.4, Character Set Description File, it is implementation-defined whether or not users or applications can provide additional character set description files. Therefore, the -f option might be operable only when an implementation-defined charmap is named.
None.
The output produced by the localedef utility is implementation-defined. The name operand is used to identify the specific locale. (As a consequence, although several categories can be processed in one execution, only categories belonging to the same locale can be processed.)
None.
locale
The Base Definitions volume of POSIX.1‐2017, Section 6.4, Character Set Description File, Chapter 7, Locale, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
2017 | IEEE/The Open Group |