2015-08-07 23:53:31 +00:00
|
|
|
.\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved
|
|
|
|
.\" Portions Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
|
|
|
|
.\" Portions Copyright 2013 DEY Storage Systems, Inc.
|
|
|
|
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
|
|
|
|
.\" permission to reproduce portions of its copyrighted documentation.
|
|
|
|
.\" Original documentation from The Open Group can be obtained online at
|
|
|
|
.\" http://www.opengroup.org/bookstore/.
|
|
|
|
.\" The Institute of Electrical and Electronics Engineers and The Open Group,
|
|
|
|
.\" have given us permission to reprint portions of their documentation. In
|
|
|
|
.\" the following statement, the phrase "this text" refers to portions of the
|
|
|
|
.\" system documentation. Portions of this text are reprinted and reproduced
|
|
|
|
.\" in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1,
|
|
|
|
.\" 2004 Edition, Standard for Information Technology -- Portable Operating
|
|
|
|
.\" System Interface (POSIX), The Open Group Base Specifications Issue 6,
|
|
|
|
.\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
|
|
|
|
.\" Engineers, Inc and The Open Group. In the event of any discrepancy between
|
|
|
|
.\" these versions 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.
|
|
|
|
.\" This notice shall appear on any product containing this material.
|
|
|
|
.\" The contents of this file are subject to the terms of the Common
|
|
|
|
.\" Development and Distribution License (the "License"). You may not use
|
|
|
|
.\" this file except in compliance with the License.
|
|
|
|
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or
|
|
|
|
.\" http://www.opensolaris.org/os/licensing. See the License for the specific
|
|
|
|
.\" language governing permissions and limitations under the License.
|
|
|
|
.\" When distributing Covered Code, include this CDDL HEADER in each file and
|
|
|
|
.\" include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable,
|
|
|
|
.\" add the following below this CDDL HEADER, with the fields enclosed by
|
|
|
|
.\" brackets "[]" replaced with your own identifying information:
|
|
|
|
.\" Portions Copyright [yyyy] [name of copyright owner]
|
2015-11-07 20:36:54 +00:00
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2015-08-07 23:53:31 +00:00
|
|
|
.Dd July 28, 2015
|
|
|
|
.Dt LOCALEDEF 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm localedef
|
|
|
|
.Nd define locale environment
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2015-11-07 20:36:54 +00:00
|
|
|
.Op Fl cDUv
|
2015-08-07 23:53:31 +00:00
|
|
|
.Op Fl f Ar charmap
|
|
|
|
.Op Fl i Ar sourcefile
|
|
|
|
.Op Fl u Ar codeset
|
2015-11-07 20:36:54 +00:00
|
|
|
.Op Fl w Ar widthfile
|
|
|
|
.Ar localename
|
2015-08-07 23:53:31 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
2015-11-07 20:36:54 +00:00
|
|
|
.Nm
|
2015-08-07 23:53:31 +00:00
|
|
|
utility converts 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; see
|
2015-11-07 20:36:54 +00:00
|
|
|
.Xr environ 7 .
|
2015-08-07 23:53:31 +00:00
|
|
|
.Pp
|
|
|
|
The utility reads source definitions for one or more locale categories
|
2015-11-07 20:36:54 +00:00
|
|
|
belonging to the same locale from the file named in the
|
|
|
|
.Fl i
|
|
|
|
option (if specified) or from standard input.
|
2015-08-07 23:53:31 +00:00
|
|
|
.Pp
|
|
|
|
Each category source definition is identified by the corresponding environment
|
|
|
|
variable name and terminated by an
|
|
|
|
.Sy END
|
|
|
|
.Em category-name
|
2015-11-07 20:36:54 +00:00
|
|
|
statement.
|
|
|
|
The following categories are supported:
|
|
|
|
.Bl -tag -width ".Ev LC_MONETARY"
|
|
|
|
.It Ev LC_CTYPE
|
2015-08-07 23:53:31 +00:00
|
|
|
Defines character classification and case conversion.
|
2015-11-07 20:36:54 +00:00
|
|
|
.It Ev LC_COLLATE
|
2015-08-07 23:53:31 +00:00
|
|
|
Defines collation rules.
|
2015-11-07 20:36:54 +00:00
|
|
|
.It Ev LC_MONETARY
|
2015-08-07 23:53:31 +00:00
|
|
|
Defines the format and symbols used in formatting of monetary information.
|
2015-11-07 20:36:54 +00:00
|
|
|
.It Ev LC_NUMERIC
|
2015-08-07 23:53:31 +00:00
|
|
|
Defines the decimal delimiter, grouping and grouping symbol for non-monetary
|
|
|
|
numeric editing.
|
2015-11-07 20:36:54 +00:00
|
|
|
.It Ev LC_TIME
|
2015-08-07 23:53:31 +00:00
|
|
|
Defines the format and content of date and time information.
|
2015-11-07 20:36:54 +00:00
|
|
|
.It Ev LC_MESSAGES
|
2015-08-07 23:53:31 +00:00
|
|
|
Defines the format and values of affirmative and negative responses.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The following options are supported:
|
2015-11-07 20:36:54 +00:00
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl c
|
2015-08-07 23:53:31 +00:00
|
|
|
Creates permanent output even if warning messages have been issued.
|
2015-11-07 20:36:54 +00:00
|
|
|
.It Fl D
|
2015-11-07 21:07:40 +00:00
|
|
|
BSD-style
|
2015-11-07 20:36:54 +00:00
|
|
|
output.
|
|
|
|
Rather than the default of creating the
|
|
|
|
.Ar localename
|
|
|
|
directory and creating files like
|
|
|
|
.Pa LC_CTYPE ,
|
|
|
|
.Pa LC_COLLATE ,
|
|
|
|
etc.\& in that directory,
|
|
|
|
the output file names have the format
|
|
|
|
.Dq <localename>.<category>
|
|
|
|
and are dumped to the current directory.
|
|
|
|
.It Fl f Ar charmap
|
|
|
|
Specifies 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
|
|
|
|
.Sy collating-symbol
|
|
|
|
keyword) are used.
|
|
|
|
If the
|
|
|
|
.Fl f
|
|
|
|
option is not present, the default character mapping will be used.
|
|
|
|
.It Fl i Ar sourcefile
|
|
|
|
The path name of a file containing the source definitions.
|
|
|
|
If this option is not present, source definitions will be read from
|
|
|
|
standard input.
|
|
|
|
.It Fl u Ar codeset
|
|
|
|
Specifies 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 10646-1:2000 standard position constant values.
|
|
|
|
See
|
|
|
|
.Sx NOTES .
|
|
|
|
.It Fl U
|
2015-08-07 23:53:31 +00:00
|
|
|
Ignore the presence of character symbols that have no matching character
|
|
|
|
definition. This facilitates the use of a common locale definition file
|
|
|
|
to be used across multiple encodings, even when some symbols are not
|
|
|
|
present in a given encoding.
|
2015-11-07 20:36:54 +00:00
|
|
|
.It Fl v
|
|
|
|
Emit verbose debugging output on standard output.
|
|
|
|
.It Fl w Ar widthfile
|
2015-08-07 23:53:31 +00:00
|
|
|
The path name of the file containing character screen width definitions.
|
|
|
|
If not supplied, then default screen widths will be assumed, which will
|
|
|
|
generally not account for East Asian encodings requiring more than a single
|
|
|
|
character cell to display, nor for combining or accent marks that occupy
|
|
|
|
no additional screen width.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The following operands are required:
|
2015-11-07 20:36:54 +00:00
|
|
|
.Bl -tag -width ".Ar localename"
|
|
|
|
.It Ar localename
|
|
|
|
Identifies the locale.
|
|
|
|
If the name contains one or more slash characters,
|
2015-08-07 23:53:31 +00:00
|
|
|
.Ar localename
|
|
|
|
will be interpreted as a path name where the created locale
|
2015-11-07 20:36:54 +00:00
|
|
|
definitions will be stored.
|
|
|
|
This capability may be restricted to users with appropriate privileges.
|
|
|
|
(As a consequence of specifying one
|
2015-08-07 23:53:31 +00:00
|
|
|
.Ar localename ,
|
|
|
|
although several categories can be processed in one execution, only categories
|
|
|
|
belonging to the same locale can be processed.)
|
|
|
|
.El
|
|
|
|
.Sh OUTPUT
|
|
|
|
.Nm
|
2015-11-07 20:36:54 +00:00
|
|
|
creates a directory of files that represents the locale's data,
|
|
|
|
unless instructed otherwise by the
|
|
|
|
.Fl D (
|
2015-11-07 21:07:40 +00:00
|
|
|
BSD
|
2015-11-07 20:36:54 +00:00
|
|
|
output) option.
|
|
|
|
The contants of this directory should generally be copied into the
|
|
|
|
appropriate subdirectory of
|
|
|
|
.Pa /usr/share/locale
|
|
|
|
in order the definitions to be visible to programs linked with libc.
|
2015-08-07 23:53:31 +00:00
|
|
|
.Sh ENVIRONMENT
|
|
|
|
See
|
2015-11-07 20:36:54 +00:00
|
|
|
.Xr environ 7
|
|
|
|
for definitions of the following environment variables that affect the
|
|
|
|
execution of
|
2015-08-07 23:53:31 +00:00
|
|
|
.Nm :
|
2015-11-07 20:36:54 +00:00
|
|
|
.Ev LANG ,
|
|
|
|
.Ev LC_ALL ,
|
|
|
|
.Ev LC_COLLATE ,
|
|
|
|
.Ev LC_CTYPE ,
|
|
|
|
.Ev LC_MESSAGES ,
|
|
|
|
.Ev LC_MONETARY ,
|
|
|
|
.Ev LC_MUMERIC ,
|
|
|
|
.Ev LC_TIME ,
|
2015-08-07 23:53:31 +00:00
|
|
|
and
|
2015-11-07 20:36:54 +00:00
|
|
|
.Ev NLSPATH .
|
2015-08-07 23:53:31 +00:00
|
|
|
.Sh EXIT STATUS
|
|
|
|
The following exit values are returned:
|
|
|
|
.Bl -tag -width XX
|
|
|
|
.It 0
|
|
|
|
No errors occurred and the locales were successfully created.
|
|
|
|
.It 1
|
|
|
|
Warnings occurred and the locales were successfully created.
|
|
|
|
.It 2
|
|
|
|
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.
|
|
|
|
.It >3
|
|
|
|
Warnings or errors occurred and no output was created.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
If an error is detected, no permanent output will be created.
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr locale 1 ,
|
|
|
|
.Xr iconv_open 3 ,
|
|
|
|
.Xr nl_langinfo 3 ,
|
|
|
|
.Xr strftime 3 ,
|
2015-11-07 20:36:54 +00:00
|
|
|
.Xr environ 7
|
2015-08-07 23:53:31 +00:00
|
|
|
.Sh WARNINGS
|
|
|
|
If warnings occur, permanent output will be created if the
|
2015-11-07 20:36:54 +00:00
|
|
|
.Fl c
|
|
|
|
option was specified.
|
|
|
|
The following conditions will cause warning messages to be issued:
|
|
|
|
.Bl -bullet
|
|
|
|
.It
|
2015-08-07 23:53:31 +00:00
|
|
|
If a symbolic name not found in the
|
2015-11-07 20:36:54 +00:00
|
|
|
.Pa charmap
|
2015-08-07 23:53:31 +00:00
|
|
|
file is used for the descriptions of the
|
|
|
|
.Sy LC_CTYPE
|
|
|
|
or
|
|
|
|
.Sy LC_COLLATE
|
|
|
|
categories (for other categories, this will be an error condition).
|
2015-11-07 20:36:54 +00:00
|
|
|
.It
|
2015-08-07 23:53:31 +00:00
|
|
|
If optional keywords not supported by the implementation are present in the
|
|
|
|
source.
|
|
|
|
.El
|
|
|
|
.Sh NOTES
|
|
|
|
When the
|
2015-11-07 20:36:54 +00:00
|
|
|
.Fl u
|
2015-08-07 23:53:31 +00:00
|
|
|
option is used, the
|
2015-11-07 20:36:54 +00:00
|
|
|
.Ar codeset
|
2015-08-07 23:53:31 +00:00
|
|
|
option-argument is interpreted as a name of a codeset to which the
|
2015-11-07 20:36:54 +00:00
|
|
|
ISO/IEC 10646-1:2000 standard position constant values are converted.
|
|
|
|
Both the ISO/IEC 10646-1:2000 standard position constant values and
|
|
|
|
other formats (decimal, hexadecimal, or octal) are valid as encoding
|
|
|
|
values within the charmap file.
|
|
|
|
The
|
|
|
|
.Ar codeset
|
|
|
|
can be any codeset that is supported by the
|
|
|
|
.Fn iconv_open 3
|
|
|
|
function.
|
2015-08-07 23:53:31 +00:00
|
|
|
.Pp
|
|
|
|
When conflicts occur between the charmap specification of
|
2015-11-07 20:36:54 +00:00
|
|
|
.Ar codeset ,
|
2015-08-07 23:53:31 +00:00
|
|
|
.Em mb_cur_max ,
|
|
|
|
or
|
|
|
|
.Em mb_cur_min
|
|
|
|
and the corresponding value for the codeset represented by the
|
2015-11-07 20:36:54 +00:00
|
|
|
.Fl u
|
2015-08-07 23:53:31 +00:00
|
|
|
option-argument
|
2015-11-07 20:36:54 +00:00
|
|
|
.Ar codeset ,
|
2015-08-07 23:53:31 +00:00
|
|
|
the
|
|
|
|
.Nm
|
2015-11-07 20:36:54 +00:00
|
|
|
utility fails with an error.
|
2015-08-07 23:53:31 +00:00
|
|
|
.Pp
|
|
|
|
When conflicts occur between the charmap encoding values specified for symbolic
|
|
|
|
names of characters of the portable character set and the character encoding
|
|
|
|
values defined by the US-ASCII, the result is unspecified.
|
|
|
|
.Sh HISTORY
|
|
|
|
.Nm
|
|
|
|
first appeared in
|
2015-11-07 21:07:40 +00:00
|
|
|
.Fx 11 .
|
|
|
|
.Pp
|
|
|
|
It was written by
|
2015-08-07 23:53:31 +00:00
|
|
|
.An Garrett D'Amore
|
2015-11-07 20:36:54 +00:00
|
|
|
.Aq Mt garrett@nexenta.com
|
2015-11-07 21:07:40 +00:00
|
|
|
for Illumos.
|
2015-08-07 23:53:31 +00:00
|
|
|
.An John Marino
|
2015-11-07 20:36:54 +00:00
|
|
|
.Aq Mt draco@marino.st
|
2015-08-07 23:53:31 +00:00
|
|
|
provided the alternations necessary to compile cleanly on
|
2015-11-07 21:07:40 +00:00
|
|
|
.Dx .
|
|
|
|
.An Baptiste Daroussin
|
|
|
|
.Aq Mt bapt@FreeBSD.org
|
|
|
|
ported it to
|
|
|
|
.Fx
|
|
|
|
and converted it to
|
|
|
|
.Xr tree 3 .
|