Files
oldlinux-files/Ref-docs/POSIX/susv3/utilities/localedef.html
2024-02-19 00:21:47 -05:00

374 lines
15 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
<title>localedef</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
</script>
<basefont size="3"> <a name="localedef"></a> <a name="tag_04_77"></a><!-- localedef -->
<!--header start-->
<center><font size="2">The Open Group Base Specifications Issue 6<br>
IEEE Std 1003.1-2001<br>
Copyright &copy; 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
<!--header end-->
<hr size="2" noshade>
<h4><a name="tag_04_77_01"></a>NAME</h4>
<blockquote>localedef - define locale environment</blockquote>
<h4><a name="tag_04_77_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<p><code><tt>localedef</tt> <b>[</b><tt>-c</tt><b>][</b><tt>-f</tt> <i>charmap</i><b>][</b><tt>-i</tt>
<i>sourcefile</i><b>][</b><tt>-u</tt> <i>code_set_name</i><b>]</b> <i>name</i></code></p>
</blockquote>
<h4><a name="tag_04_77_03"></a>DESCRIPTION</h4>
<blockquote>
<p>The <i>localedef</i> 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 IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap07.html">Chapter 7, Locale</a>. 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. <sup>[<a
href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> &nbsp;On
XSI-conformant systems, the symbolic constant POSIX2_LOCALEDEF shall be defined. <img src="../images/opt-end.gif" alt=
"[Option End]" border="0"></p>
<p>The utility shall read source definitions for one or more locale categories belonging to the same locale from the file named in
the <b>-i</b> option (if specified) or from standard input.</p>
<p>The <i>name</i> operand identifies the target locale. The utility shall support the creation of <i>public</i>, or generally
accessible locales, as well as <i>private</i>, or restricted-access locales. Implementations may restrict the capability to create
or modify public locales to users with the appropriate privileges.</p>
<p>Each category source definition shall be identified by the corresponding environment variable name and terminated by an
<b>END</b> <i>category-name</i> statement. The following categories shall be supported. In addition, the input may contain source
for implementation-defined categories.</p>
<dl compact>
<dt><i>LC_CTYPE</i></dt>
<dd>Defines character classification and case conversion.</dd>
<dt><i>LC_COLLATE</i></dt>
<dd><br>
Defines collation rules.</dd>
<dt><i>LC_MONETARY</i></dt>
<dd><br>
Defines the format and symbols used in formatting of monetary information.</dd>
<dt><i>LC_NUMERIC</i></dt>
<dd><br>
Defines the decimal delimiter, grouping, and grouping symbol for non-monetary numeric editing.</dd>
<dt><i>LC_TIME</i></dt>
<dd>Defines the format and content of date and time information.</dd>
<dt><i>LC_MESSAGES</i></dt>
<dd><br>
Defines the format and values of affirmative and negative responses.</dd>
</dl>
</blockquote>
<h4><a name="tag_04_77_04"></a>OPTIONS</h4>
<blockquote>
<p>The <i>localedef</i> utility shall conform to the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href=
"../basedefs/xbd_chap12.html#tag_12_02">Section 12.2, Utility Syntax Guidelines</a>.</p>
<p>The following options shall be supported:</p>
<dl compact>
<dt><b>-c</b></dt>
<dd>Create permanent output even if warning messages have been issued.</dd>
<dt><b>-f&nbsp;</b> <i>charmap</i></dt>
<dd>Specify the pathname of a file containing a mapping of character symbols and collating element symbols to actual character
encodings. The format of the <i>charmap</i> is described in the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href=
"../basedefs/xbd_chap06.html#tag_06_04">Section 6.4, Character Set Description File</a>. The application shall ensure that this
option is specified if symbolic names (other than collating symbols defined in a <b>collating-symbol</b> keyword) are used. If the
<b>-f</b> option is not present, an implementation-defined character mapping shall be used.</dd>
<dt><b>-i&nbsp;</b> <i>inputfile</i></dt>
<dd>The pathname of a file containing the source definitions. If this option is not present, source definitions shall be read from
standard input. The format of the <i>inputfile</i> is described in the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001,
<a href="../basedefs/xbd_chap07.html#tag_07_03">Section 7.3, Locale Definition</a>.</dd>
<dt><b>-u&nbsp;</b> <i>code_set_name</i></dt>
<dd><br>
Specify the name of a codeset used as the target mapping of character symbols and collating element symbols whose encoding values
are defined in terms of the ISO/IEC&nbsp;10646-1:2000 standard position constant values.</dd>
</dl>
</blockquote>
<h4><a name="tag_04_77_05"></a>OPERANDS</h4>
<blockquote>
<p>The following operand shall be supported:</p>
<dl compact>
<dt><i>name</i></dt>
<dd>Identifies the locale; see the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href=
"../basedefs/xbd_chap07.html">Chapter 7, Locale</a> for a description of the use of this name. If the name contains one or more
slash characters, <i>name</i> shall be interpreted as a pathname where the created locale definitions shall be stored. If
<i>name</i> does not contain any slash characters, the interpretation of the name is implementation-defined and the locale shall be
public. This capability may be restricted to users with appropriate privileges. (As a consequence of specifying one <i>name</i>,
although several categories can be processed in one execution, only categories belonging to the same locale can be processed.)</dd>
</dl>
</blockquote>
<h4><a name="tag_04_77_06"></a>STDIN</h4>
<blockquote>
<p>Unless the <b>-i</b> 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 IEEE&nbsp;Std&nbsp;1003.1-2001, <a href=
"../basedefs/xbd_chap07.html#tag_07_03">Section 7.3, Locale Definition</a>. When lines are continued using the escape character
mechanism, there is no limit to the length of the accumulated continued line.</p>
</blockquote>
<h4><a name="tag_04_77_07"></a>INPUT FILES</h4>
<blockquote>
<p>The character set mapping file specified as the <i>charmap</i> option-argument is described in the Base Definitions volume of
IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap06.html#tag_06_04">Section 6.4, Character Set Description File</a>. If
a locale category source definition contains a <b>copy</b> statement, as defined in the Base Definitions volume of
IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap07.html">Chapter 7, Locale</a>, and the <b>copy</b> statement names a
valid, existing locale, then <i>localedef</i> shall behave as if the source definition had contained a valid category source
definition for the named locale.</p>
</blockquote>
<h4><a name="tag_04_77_08"></a>ENVIRONMENT VARIABLES</h4>
<blockquote>
<p>The following environment variables shall affect the execution of <i>localedef</i>:</p>
<dl compact>
<dt><i>LANG</i></dt>
<dd>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of
IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a> for
the precedence of internationalization variables used to determine the values of locale categories.)</dd>
<dt><i>LC_ALL</i></dt>
<dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
<dt><i>LC_COLLATE</i></dt>
<dd><br>
(This variable has no affect on <i>localedef</i>; the POSIX locale is used for this category.)</dd>
<dt><i>LC_CTYPE</i></dt>
<dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
opposed to multi-byte characters in arguments and input files). This variable has no affect on the processing of <i>localedef</i>
input data; the POSIX locale is used for this purpose, regardless of the value of this variable.</dd>
<dt><i>LC_MESSAGES</i></dt>
<dd>Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard
error.</dd>
<dt><i>NLSPATH</i></dt>
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
Determine the location of message catalogs for the processing of <i>LC_MESSAGES .</i> <img src="../images/opt-end.gif" alt=
"[Option End]" border="0"></dd>
</dl>
</blockquote>
<h4><a name="tag_04_77_09"></a>ASYNCHRONOUS EVENTS</h4>
<blockquote>
<p>Default.</p>
</blockquote>
<h4><a name="tag_04_77_10"></a>STDOUT</h4>
<blockquote>
<p>The utility shall report all categories successfully processed, in an unspecified format.</p>
</blockquote>
<h4><a name="tag_04_77_11"></a>STDERR</h4>
<blockquote>
<p>The standard error shall be used only for diagnostic messages.</p>
</blockquote>
<h4><a name="tag_04_77_12"></a>OUTPUT FILES</h4>
<blockquote>
<p>The format of the created output is unspecified. If the <i>name</i> operand does not contain a slash, the existence of an output
file for the locale is unspecified.</p>
</blockquote>
<h4><a name="tag_04_77_13"></a>EXTENDED DESCRIPTION</h4>
<blockquote>
<p>When the <b>-u</b> option is used, the <i>code_set_name</i> option-argument shall be interpreted as an implementation-defined
name of a codeset to which the ISO/IEC&nbsp;10646-1:2000 standard position constant values shall be converted via an
implementation-defined method. Both the ISO/IEC&nbsp;10646-1:2000 standard position constant values and other formats (decimal,
hexadecimal, or octal) shall be valid as encoding values within the <i>charmap</i> file. The codeset represented by the
implementation-defined name can be any codeset that is supported by the implementation.</p>
<p>When conflicts occur between the <i>charmap</i> specification of &lt;<i>code_set_name</i>&gt;, &lt;<i>mb_cur_max</i>&gt;, or
&lt;<i>mb_cur_min</i>&gt; and the implementation-defined interpretation of these respective items for the codeset represented by
the <b>-u</b> option-argument <i>code_set_name</i>, the result is unspecified.</p>
<p>When conflicts occur between the <i>charmap</i> 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.</p>
<p>If a non-printable character in the <i>charmap</i> has a width specified that is not <b>-1</b>, <i>localedef</i> shall generate
a warning.</p>
</blockquote>
<h4><a name="tag_04_77_14"></a>EXIT STATUS</h4>
<blockquote>
<p>The following exit values shall be returned:</p>
<dl compact>
<dt>&nbsp;0</dt>
<dd>No errors occurred and the locales were successfully created.</dd>
<dt>&nbsp;1</dt>
<dd>Warnings occurred and the locales were successfully created.</dd>
<dt>&nbsp;2</dt>
<dd>The locale specification exceeded implementation limits or the coded character set or sets used were not supported by the
implementation, and no locale was created.</dd>
<dt>&nbsp;3</dt>
<dd>The capability to create new locales is not supported by the implementation.</dd>
<dt>&gt;3</dt>
<dd>Warnings or errors occurred and no output was created.</dd>
</dl>
</blockquote>
<h4><a name="tag_04_77_15"></a>CONSEQUENCES OF ERRORS</h4>
<blockquote>
<p>If an error is detected, no permanent output shall be created.</p>
<p>If warnings occur, permanent output shall be created if the <b>-c</b> option was specified. The following conditions shall cause
warning messages to be issued:</p>
<ul>
<li>
<p>If a symbolic name not found in the <i>charmap</i> file is used for the descriptions of the <i>LC_CTYPE</i> or <i>LC_COLLATE</i>
categories (for other categories, this shall be an error condition).</p>
</li>
<li>
<p>If the number of operands to the <b>order</b> keyword exceeds the {COLL_WEIGHTS_MAX} limit.</p>
</li>
<li>
<p>If optional keywords not supported by the implementation are present in the source.</p>
</li>
<li>
<p>If a non-printable character has a width specified other than -1.</p>
</li>
</ul>
<p>Other implementation-defined conditions may also cause warnings.</p>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_04_77_16"></a>APPLICATION USAGE</h4>
<blockquote>
<p>The <i>charmap</i> 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 <i>charmap</i>
definitions must use the same symbolic names for the portable character set. As explained in the Base Definitions volume of
IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap06.html#tag_06_04">Section 6.4, Character Set Description File</a>, it
is implementation-defined whether or not users or applications can provide additional character set description files. Therefore,
the <b>-f</b> option might be operable only when an implementation-defined <i>charmap</i> is named.</p>
</blockquote>
<h4><a name="tag_04_77_17"></a>EXAMPLES</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_04_77_18"></a>RATIONALE</h4>
<blockquote>
<p>The output produced by the <i>localedef</i> utility is implementation-defined. The <i>name</i> 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.)</p>
</blockquote>
<h4><a name="tag_04_77_19"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_04_77_20"></a>SEE ALSO</h4>
<blockquote>
<p><a href="locale.html"><i>locale</i></a> , the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href=
"../basedefs/xbd_chap07.html#tag_07_03">Section 7.3, Locale Definition</a></p>
</blockquote>
<h4><a name="tag_04_77_21"></a>CHANGE HISTORY</h4>
<blockquote>
<p>First released in Issue 4.</p>
</blockquote>
<h4><a name="tag_04_77_22"></a>Issue 6</h4>
<blockquote>
<p>The <b>-u</b> option is added, as specified in the IEEE&nbsp;P1003.2b draft standard.</p>
<p>The normative text is reworded to avoid use of the term &quot;must&quot; for application requirements.</p>
</blockquote>
<div class="box"><em>End of informative text.</em></div>
<hr>
<hr size="2" noshade>
<center><font size="2"><!--footer start-->
UNIX &reg; is a registered Trademark of The Open Group.<br>
POSIX &reg; is a registered Trademark of The IEEE.<br>
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
]</font></center>
<!--footer end-->
<hr size="2" noshade>
</body>
</html>