1 .\"
   2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
   3 .\" permission to reproduce portions of its copyrighted documentation.
   4 .\" Original documentation from The Open Group can be obtained online at
   5 .\" http://www.opengroup.org/bookstore/.
   6 .\"
   7 .\" The Institute of Electrical and Electronics Engineers and The Open
   8 .\" Group, have given us permission to reprint portions of their
   9 .\" documentation.
  10 .\"
  11 .\" In the following statement, the phrase ``this text'' refers to portions
  12 .\" of the system documentation.
  13 .\"
  14 .\" Portions of this text are reprinted and reproduced in electronic form
  15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
  16 .\" Standard for Information Technology -- Portable Operating System
  17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
  18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
  19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
  20 .\" between these versions and the original IEEE and The Open Group
  21 .\" Standard, the original IEEE and The Open Group Standard is the referee
  22 .\" document.  The original Standard can be obtained online at
  23 .\" http://www.opengroup.org/unix/online.html.
  24 .\"
  25 .\" This notice shall appear on any product containing this material.
  26 .\"
  27 .\" The contents of this file are subject to the terms of the
  28 .\" Common Development and Distribution License (the "License").
  29 .\" You may not use this file except in compliance with the License.
  30 .\"
  31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  32 .\" or http://www.opensolaris.org/os/licensing.
  33 .\" See the License for the specific language governing permissions
  34 .\" and limitations under the License.
  35 .\"
  36 .\" When distributing Covered Code, include this CDDL HEADER in each
  37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  38 .\" If applicable, add the following below this CDDL HEADER, with the
  39 .\" fields enclosed by brackets "[]" replaced with your own identifying
  40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  41 .\"
  42 .\"
  43 .\" Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
  44 .\" Portions Copyright (c) 2003, Sun Microsystems, Inc.  All Rights Reserved
  45 .\" Portions Copyright 2013 DEY Storage Systems, Inc.
  46 .\"
  47 .TH LOCALEDEF 1 "April 9, 2016"
  48 .SH NAME
  49 localedef \- define locale environment
  50 .SH SYNOPSIS
  51 .nf
  52 \fBlocaledef\fR [\fB-c\fR] [\fB-v\fR] [\fB-U\fR] [\fB-f\fR \fIcharmap\fR]
  53      [\fB-w\fR \fIwidthfile\fR] [\fB-i\fR \fIsourcefile\fR]
  54      [\fB-u\fR \fIcode_set_name\fR] \fIlocalename\fR
  55 .fi
  56 
  57 .SH DESCRIPTION
  58 The \fBlocaledef\fR utility converts source definitions for locale categories
  59 into a format usable by the functions and utilities whose operational behavior
  60 is determined by the setting of the locale environment variables; see
  61 \fBenviron\fR(5).
  62 .sp
  63 .LP
  64 The utility reads source definitions for one or more locale categories
  65 belonging to the same locale from the file named in the \fB-i\fR option (if
  66 specified) or from standard input.
  67 .sp
  68 .LP
  69 Each category source definition is identified by the corresponding environment
  70 variable name and terminated by an \fBEND\fR \fIcategory-name\fR statement. The
  71 following categories are supported.
  72 .sp
  73 .ne 2
  74 .na
  75 \fB\fBLC_CTYPE\fR\fR
  76 .ad
  77 .RS 15n
  78 Defines character classification and case conversion.
  79 .RE
  80 
  81 .sp
  82 .ne 2
  83 .na
  84 \fB\fBLC_COLLATE\fR\fR
  85 .ad
  86 .RS 15n
  87 Defines collation rules.
  88 .RE
  89 
  90 .sp
  91 .ne 2
  92 .na
  93 \fB\fBLC_MONETARY\fR\fR
  94 .ad
  95 .RS 15n
  96 Defines the format and symbols used in formatting of monetary information.
  97 .RE
  98 
  99 .sp
 100 .ne 2
 101 .na
 102 \fB\fBLC_NUMERIC\fR\fR
 103 .ad
 104 .RS 15n
 105 Defines the decimal delimiter, grouping and grouping symbol for non-monetary
 106 numeric editing.
 107 .RE
 108 
 109 .sp
 110 .ne 2
 111 .na
 112 \fB\fBLC_TIME\fR\fR
 113 .ad
 114 .RS 15n
 115 Defines the format and content of date and time information.
 116 .RE
 117 
 118 .sp
 119 .ne 2
 120 .na
 121 \fB\fBLC_MESSAGES\fR\fR
 122 .ad
 123 .RS 15n
 124 Defines the format and values of affirmative and negative responses.
 125 .RE
 126 
 127 .SH OPTIONS
 128 The following options are supported:
 129 .sp
 130 .ne 2
 131 .na
 132 \fB\fB-c\fR\fR
 133 .ad
 134 .RS 23n
 135 Creates permanent output even if warning messages have been issued.
 136 .RE
 137 
 138 .sp
 139 .ne 2
 140 .na
 141 \fB\fB-v\fR\fR
 142 .ad
 143 .RS 23n
 144 Emit verbose debugging output on standard output.
 145 .RE
 146 
 147 .sp
 148 .ne 2
 149 .na
 150 \fB\fB-U\fR\fR
 151 .ad
 152 .RS 23n
 153 Ignore the presence of character symbols that have no matching character
 154 definition.  This facilitates the use of a common locale definition file
 155 to be used across multiple encodings, even when some symbols are not
 156 present in a given encoding.
 157 .sp
 158 Support for this option is an illumos extension.
 159 .RE
 160 
 161 .sp
 162 .ne 2
 163 .na
 164 \fB\fB-f\fR \fIcharmap\fR\fR
 165 .ad
 166 .RS 23n
 167 Specifies the pathname of a file containing a mapping of character symbols and
 168 collating element symbols to actual character encodings. This option must be
 169 specified if symbolic names (other than collating symbols defined in a
 170 \fBcollating-symbol\fR keyword) are used. If the \fB-f\fR option is not
 171 present, the default character mapping will be used.
 172 .RE
 173 
 174 .sp
 175 .ne 2
 176 .na
 177 \fB\fB-w\fR \fIwidthfile\fR\fR
 178 .ad
 179 .RS 23n
 180 The path name of the file containing character screen width definitions.
 181 If not supplied, then default screen widths will be assumed, which will
 182 generally not account for East Asian encodings requiring more than a single
 183 character cell to display, nor for combining or accent marks that occupy
 184 no additional screen width.
 185 .sp
 186 The support for width files is an illumos extension.
 187 .RE
 188 
 189 .sp
 190 .ne 2
 191 .na
 192 \fB\fB-i\fR \fIsourcefile\fR\fR
 193 .ad
 194 .RS 23n
 195 The path name of a file containing the source definitions. If this option is
 196 not present, source definitions will be read from standard input.
 197 .RE
 198 
 199 .sp
 200 .ne 2
 201 .na
 202 \fB\fB-u\fR \fIcode_set_name\fR\fR
 203 .ad
 204 .RS 23n
 205 Specifies the name of a codeset used as the target mapping of character symbols
 206 and collating element symbols whose encoding values are defined in terms of the
 207 ISO/IEC 10646-1: 2000 standard position constant values. See NOTES.
 208 .RE
 209 
 210 .SH OPERANDS
 211 The following operand is supported:
 212 .sp
 213 .ne 2
 214 .na
 215 \fB\fIlocalename\fR\fR
 216 .ad
 217 .RS 14n
 218 Identifies the locale. If the name contains one or more slash characters,
 219 \fIlocalename\fR will be interpreted as a path name where the created locale
 220 definitions will be stored. This capability may be restricted to users with
 221 appropriate privileges. (As a consequence of specifying one \fIlocalename\fR,
 222 although several categories can be processed in one execution, only categories
 223 belonging to the same locale can be processed.)
 224 .RE
 225 
 226 .SH OUTPUT
 227 \fBlocaledef\fR creates a directory of files that represents the locale's
 228 data. The contents of this directory should generally be copied into the
 229 appropriate subdirectory of /usr/lib/locale in order the definitions to
 230 be visible to programs linked with libc.
 231 .sp
 232 .SH ENVIRONMENT VARIABLES
 233 See \fBenviron\fR(5) for definitions of the following environment variables
 234 that affect the execution of \fBlocaledef\fR: \fBLANG\fR, \fBLC_ALL\fR,
 235 \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
 236 .SH EXIT STATUS
 237 The following exit values are returned:
 238 .sp
 239 .ne 2
 240 .na
 241 \fB\fB0\fR\fR
 242 .ad
 243 .RS 6n
 244 No errors occurred and the locales were successfully created.
 245 .RE
 246 
 247 .sp
 248 .ne 2
 249 .na
 250 \fB\fB1\fR\fR
 251 .ad
 252 .RS 6n
 253 Warnings occurred and the locales were successfully created.
 254 .RE
 255 
 256 .sp
 257 .ne 2
 258 .na
 259 \fB\fB2\fR\fR
 260 .ad
 261 .RS 6n
 262 The locale specification exceeded implementation limits or the coded character
 263 set or sets used were not supported by the implementation, and no locale was
 264 created.
 265 .RE
 266 
 267 .sp
 268 .ne 2
 269 .na
 270 \fB\fB>3\fR\fR
 271 .ad
 272 .RS 6n
 273 Warnings or errors occurred and no output was created.
 274 .RE
 275 
 276 .sp
 277 .LP
 278 If an error is detected, no permanent output will be created.
 279 .SH FILES
 280 .ne 2
 281 .na
 282 \fB/usr/lib/locale/\fR\fIlocalename\fR\fB/\fR
 283 .ad
 284 .sp .6
 285 .RS 4n
 286 The directory containing locale data.
 287 .RE
 288 
 289 .SH ATTRIBUTES
 290 See \fBattributes\fR(5) for descriptions of the following attributes:
 291 .sp
 292 
 293 .sp
 294 .TS
 295 box;
 296 c | c
 297 l | l .
 298 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 299 _
 300 Interface Stability     Standard
 301 .TE
 302 
 303 .SH SEE ALSO
 304 \fBlocale\fR(1), \fBiconv_open\fR(3C), \fBnl_langinfo\fR(3C),
 305 \fBstrftime\fR(3C), \fBattributes\fR(5), \fBcharmap\fR(5), \fBenviron\fR(5),
 306 \fBextensions\fR(5), \fBlocale\fR(5), \fBstandards\fR(5)
 307 .SH WARNINGS
 308 If warnings occur, permanent output will be created if the \fB-c\fR option was
 309 specified. The following conditions will cause warning messages to be issued:
 310 .RS +4
 311 .TP
 312 .ie t \(bu
 313 .el o
 314 If a symbolic name not found in the \fIcharmap\fR file is used for the
 315 descriptions of the \fBLC_CTYPE\fR or \fBLC_COLLATE\fR categories (for other
 316 categories, this will be an error condition).
 317 .RE
 318 .RS +4
 319 .TP
 320 .ie t \(bu
 321 .el o
 322 If optional keywords not supported by the implementation are present in the
 323 source.
 324 .RE
 325 .SH NOTES
 326 When the \fB-u\fR option is used, the \fIcode_set_name\fR option-argument is
 327 interpreted as a name of a codeset to which the ISO/IEC 10646-1: 2000 standard
 328 position constant values are converted. Both the ISO/IEC 10646-1: 2000 standard
 329 position constant values and other formats (decimal, hexadecimal, or octal) are
 330 valid as encoding values within the charmap file. The codeset can be any
 331 codeset that is supported by the \fBiconv_open\fR(3C) function on the system.
 332 .sp
 333 .LP
 334 When conflicts occur between the charmap specification of \fIcode_set_name\fR,
 335 \fImb_cur_max\fR, or \fImb_cur_min\fR and the corresponding value for the
 336 codeset represented by the \fB-u\fR option-argument \fIcode_set_name\fR, the
 337 \fBlocaledef\fR utility fails as an error.
 338 .sp
 339 .LP
 340 When conflicts occur between the charmap encoding values specified for symbolic
 341 names of characters of the portable character set and the character encoding
 342 values defined by the US-ASCII, the result is unspecified.