xref: /minix3/share/man/man7/nls.7 (revision 36dcc4a4a93f782ada76dce3d52fbeab0e063cf1)
1*36dcc4a4SLionel Sambuc.\"     $NetBSD: nls.7,v 1.15 2009/04/09 02:51:54 joerg Exp $
2*36dcc4a4SLionel Sambuc.\"
3*36dcc4a4SLionel Sambuc.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
4*36dcc4a4SLionel Sambuc.\" All rights reserved.
5*36dcc4a4SLionel Sambuc.\"
6*36dcc4a4SLionel Sambuc.\" This code is derived from software contributed to The NetBSD Foundation
7*36dcc4a4SLionel Sambuc.\" by Gregory McGarry.
8*36dcc4a4SLionel Sambuc.\"
9*36dcc4a4SLionel Sambuc.\" Redistribution and use in source and binary forms, with or without
10*36dcc4a4SLionel Sambuc.\" modification, are permitted provided that the following conditions
11*36dcc4a4SLionel Sambuc.\" are met:
12*36dcc4a4SLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright
13*36dcc4a4SLionel Sambuc.\"    notice, this list of conditions and the following disclaimer.
14*36dcc4a4SLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright
15*36dcc4a4SLionel Sambuc.\"    notice, this list of conditions and the following disclaimer in the
16*36dcc4a4SLionel Sambuc.\"    documentation and/or other materials provided with the distribution.
17*36dcc4a4SLionel Sambuc.\"
18*36dcc4a4SLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19*36dcc4a4SLionel Sambuc.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20*36dcc4a4SLionel Sambuc.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21*36dcc4a4SLionel Sambuc.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22*36dcc4a4SLionel Sambuc.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23*36dcc4a4SLionel Sambuc.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24*36dcc4a4SLionel Sambuc.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25*36dcc4a4SLionel Sambuc.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26*36dcc4a4SLionel Sambuc.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27*36dcc4a4SLionel Sambuc.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28*36dcc4a4SLionel Sambuc.\" POSSIBILITY OF SUCH DAMAGE.
29*36dcc4a4SLionel Sambuc.\"
30*36dcc4a4SLionel Sambuc.Dd February 21, 2007
31*36dcc4a4SLionel Sambuc.Dt NLS 7
32*36dcc4a4SLionel Sambuc.Os
33*36dcc4a4SLionel Sambuc.Sh NAME
34*36dcc4a4SLionel Sambuc.Nm NLS
35*36dcc4a4SLionel Sambuc.Nd Native Language Support Overview
36*36dcc4a4SLionel Sambuc.Sh DESCRIPTION
37*36dcc4a4SLionel SambucNative Language Support (NLS) provides commands for a single
38*36dcc4a4SLionel Sambucworldwide operating system base.
39*36dcc4a4SLionel SambucAn internationalized system has no built-in assumptions or dependencies
40*36dcc4a4SLionel Sambucon language-specific or cultural-specific conventions such as:
41*36dcc4a4SLionel Sambuc.Pp
42*36dcc4a4SLionel Sambuc.Bl -bullet -offset indent -compact
43*36dcc4a4SLionel Sambuc.It
44*36dcc4a4SLionel SambucCharacter classifications
45*36dcc4a4SLionel Sambuc.It
46*36dcc4a4SLionel SambucCharacter comparison rules
47*36dcc4a4SLionel Sambuc.It
48*36dcc4a4SLionel SambucCharacter collation order
49*36dcc4a4SLionel Sambuc.It
50*36dcc4a4SLionel SambucNumeric and monetary formatting
51*36dcc4a4SLionel Sambuc.It
52*36dcc4a4SLionel SambucDate and time formatting
53*36dcc4a4SLionel Sambuc.It
54*36dcc4a4SLionel SambucMessage-text language
55*36dcc4a4SLionel Sambuc.It
56*36dcc4a4SLionel SambucCharacter sets
57*36dcc4a4SLionel Sambuc.El
58*36dcc4a4SLionel Sambuc.Pp
59*36dcc4a4SLionel SambucAll information pertaining to cultural conventions and language is
60*36dcc4a4SLionel Sambucobtained at program run time.
61*36dcc4a4SLionel Sambuc.Pp
62*36dcc4a4SLionel Sambuc.Dq Internationalization
63*36dcc4a4SLionel Sambuc(often abbreviated
64*36dcc4a4SLionel Sambuc.Dq i18n )
65*36dcc4a4SLionel Sambucrefers to the operation by which system software is developed to support
66*36dcc4a4SLionel Sambucmultiple cultural-specific and language-specific conventions.
67*36dcc4a4SLionel SambucThis is a generalization process by which the system is untied from
68*36dcc4a4SLionel Sambuccalling only English strings or other English-specific conventions.
69*36dcc4a4SLionel Sambuc.Dq Localization
70*36dcc4a4SLionel Sambuc(often abbreviated
71*36dcc4a4SLionel Sambuc.Dq l10n )
72*36dcc4a4SLionel Sambucrefers to the operations by which the user environment is customized to
73*36dcc4a4SLionel Sambuchandle its input and output appropriate for specific language and cultural
74*36dcc4a4SLionel Sambucconventions.
75*36dcc4a4SLionel SambucThis is a specialization process, by which generic methods already
76*36dcc4a4SLionel Sambucimplemented in an internationalized system are used in specific ways.
77*36dcc4a4SLionel SambucThe formal description of cultural conventions for some country, together
78*36dcc4a4SLionel Sambucwith all associated translations targeted to the native language, is
79*36dcc4a4SLionel Sambuccalled the
80*36dcc4a4SLionel Sambuc.Dq locale .
81*36dcc4a4SLionel Sambuc.Pp
82*36dcc4a4SLionel Sambuc.Nx
83*36dcc4a4SLionel Sambucprovides extensive support to programmers and system developers to
84*36dcc4a4SLionel Sambucenable internationalized software to be developed.
85*36dcc4a4SLionel Sambuc.Nx
86*36dcc4a4SLionel Sambucalso supplies a large variety of locales for system localization.
87*36dcc4a4SLionel Sambuc.Ss Localization of Information
88*36dcc4a4SLionel SambucAll locale information is accessible to programs at run time so that
89*36dcc4a4SLionel Sambucdata is processed and displayed correctly for specific cultural
90*36dcc4a4SLionel Sambucconventions and language.
91*36dcc4a4SLionel Sambuc.Pp
92*36dcc4a4SLionel SambucA locale is divided into categories.
93*36dcc4a4SLionel SambucA category is a group of language-specific and culture-specific conventions
94*36dcc4a4SLionel Sambucas outlined in the list above.
95*36dcc4a4SLionel SambucISO C specifies the following six standard categories supported by
96*36dcc4a4SLionel Sambuc.Nx :
97*36dcc4a4SLionel Sambuc.Pp
98*36dcc4a4SLionel Sambuc.Bl -tag -compact -width LC_MONETARYXX
99*36dcc4a4SLionel Sambuc.It Ev LC_COLLATE
100*36dcc4a4SLionel Sambucstring-collation order information
101*36dcc4a4SLionel Sambuc.It Ev LC_CTYPE
102*36dcc4a4SLionel Sambuccharacter classification, case conversion, and other character attributes
103*36dcc4a4SLionel Sambuc.It Ev LC_MESSAGES
104*36dcc4a4SLionel Sambucthe format for affirmative and negative responses
105*36dcc4a4SLionel Sambuc.It Ev LC_MONETARY
106*36dcc4a4SLionel Sambucrules and symbols for formatting monetary numeric information
107*36dcc4a4SLionel Sambuc.It Ev LC_NUMERIC
108*36dcc4a4SLionel Sambucrules and symbols for formatting nonmonetary numeric information
109*36dcc4a4SLionel Sambuc.It Ev LC_TIME
110*36dcc4a4SLionel Sambucrules and symbols for formatting time and date information
111*36dcc4a4SLionel Sambuc.El
112*36dcc4a4SLionel Sambuc.Pp
113*36dcc4a4SLionel SambucLocalization of the system is achieved by setting appropriate values
114*36dcc4a4SLionel Sambucin environment variables to identify which locale should be used.
115*36dcc4a4SLionel SambucThe environment variables have the same names as their respective
116*36dcc4a4SLionel Sambuclocale categories.
117*36dcc4a4SLionel SambucAdditionally, the
118*36dcc4a4SLionel Sambuc.Ev LANG ,
119*36dcc4a4SLionel Sambuc.Ev LC_ALL ,
120*36dcc4a4SLionel Sambucand
121*36dcc4a4SLionel Sambuc.Ev NLSPATH
122*36dcc4a4SLionel Sambucenvironment variables are used.
123*36dcc4a4SLionel SambucThe
124*36dcc4a4SLionel Sambuc.Ev NLSPATH
125*36dcc4a4SLionel Sambucenvironment variable specifies a colon-separated list of directory names
126*36dcc4a4SLionel Sambucwhere the message catalog files of the NLS database are located.
127*36dcc4a4SLionel SambucThe
128*36dcc4a4SLionel Sambuc.Ev LC_ALL
129*36dcc4a4SLionel Sambucand
130*36dcc4a4SLionel Sambuc.Ev LANG
131*36dcc4a4SLionel Sambucenvironment variables also determine the current locale.
132*36dcc4a4SLionel Sambuc.Pp
133*36dcc4a4SLionel SambucThe values of these environment variables contains a string format as:
134*36dcc4a4SLionel Sambuc.Pp
135*36dcc4a4SLionel Sambuc.Bd -literal
136*36dcc4a4SLionel Sambuc	language[_territory][.codeset][@modifier]
137*36dcc4a4SLionel Sambuc.Ed
138*36dcc4a4SLionel Sambuc.Pp
139*36dcc4a4SLionel SambucValid values for the language field come from the ISO639 standard which
140*36dcc4a4SLionel Sambucdefines two-character codes for many languages.
141*36dcc4a4SLionel SambucSome common language codes are:
142*36dcc4a4SLionel Sambuc.Pp
143*36dcc4a4SLionel Sambuc.Bl -column "PERSIAN (farsi)" "Sy Code" "OCEANIC/INDONESIAN"
144*36dcc4a4SLionel Sambuc.It Sy Language Name Ta Sy Code Ta Sy Language Family
145*36dcc4a4SLionel Sambuc.It ABKHAZIAN	AB	IBERO-CAUCASIAN
146*36dcc4a4SLionel Sambuc.It AFAN (OROMO)	OM	HAMITIC
147*36dcc4a4SLionel Sambuc.It AFAR	AA	HAMITIC
148*36dcc4a4SLionel Sambuc.It AFRIKAANS	AF	GERMANIC
149*36dcc4a4SLionel Sambuc.It ALBANIAN	SQ	INDO-EUROPEAN (OTHER)
150*36dcc4a4SLionel Sambuc.It AMHARIC	AM	SEMITIC
151*36dcc4a4SLionel Sambuc.It ARABIC	AR	SEMITIC
152*36dcc4a4SLionel Sambuc.It ARMENIAN	HY	INDO-EUROPEAN (OTHER)
153*36dcc4a4SLionel Sambuc.It ASSAMESE	AS	INDIAN
154*36dcc4a4SLionel Sambuc.It AYMARA	AY	AMERINDIAN
155*36dcc4a4SLionel Sambuc.It AZERBAIJANI	AZ	TURKIC/ALTAIC
156*36dcc4a4SLionel Sambuc.It BASHKIR	BA	TURKIC/ALTAIC
157*36dcc4a4SLionel Sambuc.It BASQUE	EU	BASQUE
158*36dcc4a4SLionel Sambuc.It BENGALI	BN	INDIAN
159*36dcc4a4SLionel Sambuc.It BHUTANI	DZ	ASIAN
160*36dcc4a4SLionel Sambuc.It BIHARI	BH	INDIAN
161*36dcc4a4SLionel Sambuc.It BISLAMA     Ta BI   Ta ""
162*36dcc4a4SLionel Sambuc.It BRETON	BR	CELTIC
163*36dcc4a4SLionel Sambuc.It BULGARIAN	BG	SLAVIC
164*36dcc4a4SLionel Sambuc.It BURMESE	MY	ASIAN
165*36dcc4a4SLionel Sambuc.It BYELORUSSIAN	BE	SLAVIC
166*36dcc4a4SLionel Sambuc.It CAMBODIAN	KM	ASIAN
167*36dcc4a4SLionel Sambuc.It CATALAN	CA	ROMANCE
168*36dcc4a4SLionel Sambuc.It CHINESE	ZH	ASIAN
169*36dcc4a4SLionel Sambuc.It CORSICAN	CO	ROMANCE
170*36dcc4a4SLionel Sambuc.It CROATIAN	HR	SLAVIC
171*36dcc4a4SLionel Sambuc.It CZECH	CS	SLAVIC
172*36dcc4a4SLionel Sambuc.It DANISH	DA	GERMANIC
173*36dcc4a4SLionel Sambuc.It DUTCH	NL	GERMANIC
174*36dcc4a4SLionel Sambuc.It ENGLISH	EN	GERMANIC
175*36dcc4a4SLionel Sambuc.It ESPERANTO	EO	INTERNATIONAL AUX.
176*36dcc4a4SLionel Sambuc.It ESTONIAN	ET	FINNO-UGRIC
177*36dcc4a4SLionel Sambuc.It FAROESE	FO	GERMANIC
178*36dcc4a4SLionel Sambuc.It FIJI	FJ	OCEANIC/INDONESIAN
179*36dcc4a4SLionel Sambuc.It FINNISH	FI	FINNO-UGRIC
180*36dcc4a4SLionel Sambuc.It FRENCH	FR	ROMANCE
181*36dcc4a4SLionel Sambuc.It FRISIAN	FY	GERMANIC
182*36dcc4a4SLionel Sambuc.It GALICIAN	GL	ROMANCE
183*36dcc4a4SLionel Sambuc.It GEORGIAN	KA	IBERO-CAUCASIAN
184*36dcc4a4SLionel Sambuc.It GERMAN	DE	GERMANIC
185*36dcc4a4SLionel Sambuc.It GREEK	EL	LATIN/GREEK
186*36dcc4a4SLionel Sambuc.It GREENLANDIC	KL	ESKIMO
187*36dcc4a4SLionel Sambuc.It GUARANI	GN	AMERINDIAN
188*36dcc4a4SLionel Sambuc.It GUJARATI	GU	INDIAN
189*36dcc4a4SLionel Sambuc.It HAUSA	HA	NEGRO-AFRICAN
190*36dcc4a4SLionel Sambuc.It HEBREW	HE	SEMITIC
191*36dcc4a4SLionel Sambuc.It HINDI	HI	INDIAN
192*36dcc4a4SLionel Sambuc.It HUNGARIAN	HU	FINNO-UGRIC
193*36dcc4a4SLionel Sambuc.It ICELANDIC	IS	GERMANIC
194*36dcc4a4SLionel Sambuc.It INDONESIAN	ID	OCEANIC/INDONESIAN
195*36dcc4a4SLionel Sambuc.It INTERLINGUA	IA	INTERNATIONAL AUX.
196*36dcc4a4SLionel Sambuc.It INTERLINGUE	IE	INTERNATIONAL AUX.
197*36dcc4a4SLionel Sambuc.It INUKTITUT   Ta IU   Ta ""
198*36dcc4a4SLionel Sambuc.It INUPIAK	IK	ESKIMO
199*36dcc4a4SLionel Sambuc.It IRISH	GA	CELTIC
200*36dcc4a4SLionel Sambuc.It ITALIAN	IT	ROMANCE
201*36dcc4a4SLionel Sambuc.It JAPANESE	JA	ASIAN
202*36dcc4a4SLionel Sambuc.It JAVANESE	JV	OCEANIC/INDONESIAN
203*36dcc4a4SLionel Sambuc.It KANNADA	KN	DRAVIDIAN
204*36dcc4a4SLionel Sambuc.It KASHMIRI	KS	INDIAN
205*36dcc4a4SLionel Sambuc.It KAZAKH	KK	TURKIC/ALTAIC
206*36dcc4a4SLionel Sambuc.It KINYARWANDA	RW	NEGRO-AFRICAN
207*36dcc4a4SLionel Sambuc.It KIRGHIZ	KY	TURKIC/ALTAIC
208*36dcc4a4SLionel Sambuc.It KURUNDI	RN	NEGRO-AFRICAN
209*36dcc4a4SLionel Sambuc.It KOREAN	KO	ASIAN
210*36dcc4a4SLionel Sambuc.It KURDISH	KU	IRANIAN
211*36dcc4a4SLionel Sambuc.It LAOTHIAN	LO	ASIAN
212*36dcc4a4SLionel Sambuc.It LATIN	LA	LATIN/GREEK
213*36dcc4a4SLionel Sambuc.It LATVIAN	LV	BALTIC
214*36dcc4a4SLionel Sambuc.It LINGALA	LN	NEGRO-AFRICAN
215*36dcc4a4SLionel Sambuc.It LITHUANIAN	LT	BALTIC
216*36dcc4a4SLionel Sambuc.It MACEDONIAN	MK	SLAVIC
217*36dcc4a4SLionel Sambuc.It MALAGASY	MG	OCEANIC/INDONESIAN
218*36dcc4a4SLionel Sambuc.It MALAY	MS	OCEANIC/INDONESIAN
219*36dcc4a4SLionel Sambuc.It MALAYALAM	ML	DRAVIDIAN
220*36dcc4a4SLionel Sambuc.It MALTESE	MT	SEMITIC
221*36dcc4a4SLionel Sambuc.It MAORI	MI	OCEANIC/INDONESIAN
222*36dcc4a4SLionel Sambuc.It MARATHI	MR	INDIAN
223*36dcc4a4SLionel Sambuc.It MOLDAVIAN	MO	ROMANCE
224*36dcc4a4SLionel Sambuc.It MONGOLIAN   Ta MN   Ta ""
225*36dcc4a4SLionel Sambuc.It NAURU       Ta NA   Ta ""
226*36dcc4a4SLionel Sambuc.It NEPALI	NE	INDIAN
227*36dcc4a4SLionel Sambuc.It NORWEGIAN	NO	GERMANIC
228*36dcc4a4SLionel Sambuc.It OCCITAN	OC	ROMANCE
229*36dcc4a4SLionel Sambuc.It ORIYA	OR	INDIAN
230*36dcc4a4SLionel Sambuc.It PASHTO	PS	IRANIAN
231*36dcc4a4SLionel Sambuc.It PERSIAN (farsi)	FA	IRANIAN
232*36dcc4a4SLionel Sambuc.It POLISH	PL	SLAVIC
233*36dcc4a4SLionel Sambuc.It PORTUGUESE	PT	ROMANCE
234*36dcc4a4SLionel Sambuc.It PUNJABI	PA	INDIAN
235*36dcc4a4SLionel Sambuc.It QUECHUA	QU	AMERINDIAN
236*36dcc4a4SLionel Sambuc.It RHAETO-ROMANCE	RM	ROMANCE
237*36dcc4a4SLionel Sambuc.It ROMANIAN	RO	ROMANCE
238*36dcc4a4SLionel Sambuc.It RUSSIAN	RU	SLAVIC
239*36dcc4a4SLionel Sambuc.It SAMOAN	SM	OCEANIC/INDONESIAN
240*36dcc4a4SLionel Sambuc.It SANGHO	SG	NEGRO-AFRICAN
241*36dcc4a4SLionel Sambuc.It SANSKRIT	SA	INDIAN
242*36dcc4a4SLionel Sambuc.It SCOTS GAELIC	GD	CELTIC
243*36dcc4a4SLionel Sambuc.It SERBIAN	SR	SLAVIC
244*36dcc4a4SLionel Sambuc.It SERBO-CROATIAN	SH	SLAVIC
245*36dcc4a4SLionel Sambuc.It SESOTHO	ST	NEGRO-AFRICAN
246*36dcc4a4SLionel Sambuc.It SETSWANA	TN	NEGRO-AFRICAN
247*36dcc4a4SLionel Sambuc.It SHONA	SN	NEGRO-AFRICAN
248*36dcc4a4SLionel Sambuc.It SINDHI	SD	INDIAN
249*36dcc4a4SLionel Sambuc.It SINGHALESE	SI	INDIAN
250*36dcc4a4SLionel Sambuc.It SISWATI	SS	NEGRO-AFRICAN
251*36dcc4a4SLionel Sambuc.It SLOVAK	SK	SLAVIC
252*36dcc4a4SLionel Sambuc.It SLOVENIAN	SL	SLAVIC
253*36dcc4a4SLionel Sambuc.It SOMALI	SO	HAMITIC
254*36dcc4a4SLionel Sambuc.It SPANISH	ES	ROMANCE
255*36dcc4a4SLionel Sambuc.It SUNDANESE	SU	OCEANIC/INDONESIAN
256*36dcc4a4SLionel Sambuc.It SWAHILI	SW	NEGRO-AFRICAN
257*36dcc4a4SLionel Sambuc.It SWEDISH	SV	GERMANIC
258*36dcc4a4SLionel Sambuc.It TAGALOG	TL	OCEANIC/INDONESIAN
259*36dcc4a4SLionel Sambuc.It TAJIK	TG	IRANIAN
260*36dcc4a4SLionel Sambuc.It TAMIL	TA	DRAVIDIAN
261*36dcc4a4SLionel Sambuc.It TATAR	TT	TURKIC/ALTAIC
262*36dcc4a4SLionel Sambuc.It TELUGU	TE	DRAVIDIAN
263*36dcc4a4SLionel Sambuc.It THAI	TH	ASIAN
264*36dcc4a4SLionel Sambuc.It TIBETAN	BO	ASIAN
265*36dcc4a4SLionel Sambuc.It TIGRINYA	TI	SEMITIC
266*36dcc4a4SLionel Sambuc.It TONGA	TO	OCEANIC/INDONESIAN
267*36dcc4a4SLionel Sambuc.It TSONGA	TS	NEGRO-AFRICAN
268*36dcc4a4SLionel Sambuc.It TURKISH	TR	TURKIC/ALTAIC
269*36dcc4a4SLionel Sambuc.It TURKMEN	TK	TURKIC/ALTAIC
270*36dcc4a4SLionel Sambuc.It TWI	TW	NEGRO-AFRICAN
271*36dcc4a4SLionel Sambuc.It UIGUR       Ta UG   Ta ""
272*36dcc4a4SLionel Sambuc.It UKRAINIAN	UK	SLAVIC
273*36dcc4a4SLionel Sambuc.It URDU	UR	INDIAN
274*36dcc4a4SLionel Sambuc.It UZBEK	UZ	TURKIC/ALTAIC
275*36dcc4a4SLionel Sambuc.It VIETNAMESE	VI	ASIAN
276*36dcc4a4SLionel Sambuc.It VOLAPUK	VO	INTERNATIONAL AUX.
277*36dcc4a4SLionel Sambuc.It WELSH	CY	CELTIC
278*36dcc4a4SLionel Sambuc.It WOLOF	WO	NEGRO-AFRICAN
279*36dcc4a4SLionel Sambuc.It XHOSA	XH	NEGRO-AFRICAN
280*36dcc4a4SLionel Sambuc.It YIDDISH	YI	GERMANIC
281*36dcc4a4SLionel Sambuc.It YORUBA	YO	NEGRO-AFRICAN
282*36dcc4a4SLionel Sambuc.It ZHUANG      Ta ZA   Ta ""
283*36dcc4a4SLionel Sambuc.It ZULU	ZU	NEGRO-AFRICAN
284*36dcc4a4SLionel Sambuc.El
285*36dcc4a4SLionel Sambuc.Pp
286*36dcc4a4SLionel SambucFor example, the locale for the Danish language spoken in Denmark
287*36dcc4a4SLionel Sambucusing the ISO 8859-1 character set is da_DK.ISO8859-1.
288*36dcc4a4SLionel SambucThe da stands for the Danish language and the DK stands for Denmark.
289*36dcc4a4SLionel SambucThe short form of da_DK is sufficient to indicate this locale.
290*36dcc4a4SLionel Sambuc.Pp
291*36dcc4a4SLionel SambucThe environment variable settings are queried by their priority level
292*36dcc4a4SLionel Sambucin the following manner:
293*36dcc4a4SLionel Sambuc.Pp
294*36dcc4a4SLionel Sambuc.Bl -bullet
295*36dcc4a4SLionel Sambuc.It
296*36dcc4a4SLionel SambucIf the
297*36dcc4a4SLionel Sambuc.Ev LC_ALL
298*36dcc4a4SLionel Sambucenvironment variable is set, all six categories use the locale it
299*36dcc4a4SLionel Sambucspecifies.
300*36dcc4a4SLionel Sambuc.It
301*36dcc4a4SLionel SambucIf the
302*36dcc4a4SLionel Sambuc.Ev LC_ALL
303*36dcc4a4SLionel Sambucenvironment variable is not set, each individual category uses the
304*36dcc4a4SLionel Sambuclocale specified by its corresponding environment variable.
305*36dcc4a4SLionel Sambuc.It
306*36dcc4a4SLionel SambucIf the
307*36dcc4a4SLionel Sambuc.Ev LC_ALL
308*36dcc4a4SLionel Sambucenvironment variable is not set, and a value for a particular
309*36dcc4a4SLionel Sambuc.Ev LC_*
310*36dcc4a4SLionel Sambucenvironment variable is not set, the value of the
311*36dcc4a4SLionel Sambuc.Ev LANG
312*36dcc4a4SLionel Sambucenvironment variable specifies the default locale for all categories.
313*36dcc4a4SLionel SambucOnly the
314*36dcc4a4SLionel Sambuc.Ev LANG
315*36dcc4a4SLionel Sambucenvironment variable should be set in /etc/profile, since it makes it
316*36dcc4a4SLionel Sambucmost easy for the user to override the system default using the individual
317*36dcc4a4SLionel Sambuc.Ev LC_*
318*36dcc4a4SLionel Sambucvariables.
319*36dcc4a4SLionel Sambuc.It
320*36dcc4a4SLionel SambucIf the
321*36dcc4a4SLionel Sambuc.Ev LC_ALL
322*36dcc4a4SLionel Sambucenvironment variable is not set, a value for a particular
323*36dcc4a4SLionel Sambuc.Ev LC_*
324*36dcc4a4SLionel Sambucenvironment variable is not set, and the value of the
325*36dcc4a4SLionel Sambuc.Ev LANG
326*36dcc4a4SLionel Sambucenvironment variable is not set, the locale for that specific
327*36dcc4a4SLionel Sambuccategory defaults to the C locale.
328*36dcc4a4SLionel SambucThe C or POSIX locale assumes the ASCII character set and defines
329*36dcc4a4SLionel Sambucinformation for the six categories.
330*36dcc4a4SLionel Sambuc.El
331*36dcc4a4SLionel Sambuc.Ss Character Sets
332*36dcc4a4SLionel SambucA character is any symbol used for the organization, control, or
333*36dcc4a4SLionel Sambucrepresentation of data.
334*36dcc4a4SLionel SambucA group of such symbols used to describe a
335*36dcc4a4SLionel Sambucparticular language make up a character set.
336*36dcc4a4SLionel SambucIt is the encoding values in a character set that provide
337*36dcc4a4SLionel Sambucthe interface between the system and its input and output devices.
338*36dcc4a4SLionel Sambuc.Pp
339*36dcc4a4SLionel SambucThe following character sets are supported in
340*36dcc4a4SLionel Sambuc.Nx :
341*36dcc4a4SLionel Sambuc.Bl -tag -width ISO_8859_family
342*36dcc4a4SLionel Sambuc.It ASCII
343*36dcc4a4SLionel SambucThe American Standard Code for Information Exchange (ASCII) standard
344*36dcc4a4SLionel Sambucspecifies 128 Roman characters and control codes, encoded in a 7-bit
345*36dcc4a4SLionel Sambuccharacter encoding scheme.
346*36dcc4a4SLionel Sambuc.It ISO 8859 family
347*36dcc4a4SLionel SambucIndustry-standard character sets specified by the ISO/IEC 8859
348*36dcc4a4SLionel Sambucstandard.
349*36dcc4a4SLionel SambucThe standard is divided into 15 numbered parts, with each
350*36dcc4a4SLionel Sambucpart specifying broad script similarities.
351*36dcc4a4SLionel SambucExamples include Western European, Central European, Arabic, Cyrillic,
352*36dcc4a4SLionel SambucHebrew, Greek, and Turkish.
353*36dcc4a4SLionel SambucThe character sets use an 8-bit character encoding scheme which is
354*36dcc4a4SLionel Sambuccompatible with the ASCII character set.
355*36dcc4a4SLionel Sambuc.It Unicode
356*36dcc4a4SLionel SambucThe Unicode character set is the full set of known abstract characters of
357*36dcc4a4SLionel Sambucall real-world scripts.  It can be used in environments where multiple
358*36dcc4a4SLionel Sambucscripts must be processed simultaneously.
359*36dcc4a4SLionel SambucUnicode is compatible with ISO 8859-1 (Western European) and ASCII.
360*36dcc4a4SLionel SambucMany character encoding schemes are available for Unicode, including UTF-8,
361*36dcc4a4SLionel SambucUTF-16 and UTF-32.
362*36dcc4a4SLionel SambucThese encoding schemes are multi-byte encodings.
363*36dcc4a4SLionel SambucThe UTF-8 encoding scheme uses 8-bit, variable-width encodings which is
364*36dcc4a4SLionel Sambuccompatible with ASCII.
365*36dcc4a4SLionel SambucThe UTF-16 encoding scheme uses 16-bit, variable-width encodings.
366*36dcc4a4SLionel SambucThe UTF-32 encoding scheme using 32-bit, fixed-width encodings.
367*36dcc4a4SLionel Sambuc.El
368*36dcc4a4SLionel Sambuc.Ss Font Sets
369*36dcc4a4SLionel SambucA font set contains the glyphs to be displayed on the screen for a
370*36dcc4a4SLionel Sambuccorresponding character in a character set.
371*36dcc4a4SLionel SambucA display must support a suitable font to display a character set.
372*36dcc4a4SLionel SambucIf suitable fonts are available to the X server, then X clients can
373*36dcc4a4SLionel Sambucinclude support for different character sets.
374*36dcc4a4SLionel Sambuc.Xr xterm 1
375*36dcc4a4SLionel Sambucincludes support for Unicode with UTF-8 encoding.
376*36dcc4a4SLionel Sambuc.Xr xfd 1
377*36dcc4a4SLionel Sambucis useful for displaying all the characters in an X font.
378*36dcc4a4SLionel Sambuc.Pp
379*36dcc4a4SLionel SambucThe
380*36dcc4a4SLionel Sambuc.Nx
381*36dcc4a4SLionel Sambuc.Xr wscons 4
382*36dcc4a4SLionel Sambucconsole provides support for loading fonts using the
383*36dcc4a4SLionel Sambuc.Xr wsfontload 8
384*36dcc4a4SLionel Sambucutility.
385*36dcc4a4SLionel SambucCurrently, only fonts for the ISO8859-1 family of character sets are
386*36dcc4a4SLionel Sambucsupported.
387*36dcc4a4SLionel Sambuc.Ss Internationalization for Programmers
388*36dcc4a4SLionel SambucTo facilitate translations of messages into various languages and to
389*36dcc4a4SLionel Sambucmake the translated messages available to the program based on a
390*36dcc4a4SLionel Sambucuser's locale, it is necessary to keep messages separate from the
391*36dcc4a4SLionel Sambucprograms and provide them in the form of message catalogs that a
392*36dcc4a4SLionel Sambucprogram can access at run time.
393*36dcc4a4SLionel Sambuc.Pp
394*36dcc4a4SLionel SambucAccess to locale information is provided through the
395*36dcc4a4SLionel Sambuc.Xr setlocale 3
396*36dcc4a4SLionel Sambucand
397*36dcc4a4SLionel Sambuc.Xr nl_langinfo 3
398*36dcc4a4SLionel Sambucinterfaces.
399*36dcc4a4SLionel SambucSee their respective man pages for further information.
400*36dcc4a4SLionel Sambuc.Pp
401*36dcc4a4SLionel SambucMessage source files containing application messages are created by
402*36dcc4a4SLionel Sambucthe programmer and converted to message catalogs.
403*36dcc4a4SLionel SambucThese catalogs are used by the application to retrieve and display
404*36dcc4a4SLionel Sambucmessages, as needed.
405*36dcc4a4SLionel Sambuc.Pp
406*36dcc4a4SLionel Sambuc.Nx
407*36dcc4a4SLionel Sambucsupports two message catalog interfaces: the X/Open
408*36dcc4a4SLionel Sambuc.Xr catgets 3
409*36dcc4a4SLionel Sambucinterface and the Uniforum
410*36dcc4a4SLionel Sambuc.Xr gettext 3
411*36dcc4a4SLionel Sambucinterface.
412*36dcc4a4SLionel SambucThe
413*36dcc4a4SLionel Sambuc.Xr catgets 3
414*36dcc4a4SLionel Sambucinterface has the advantage that it belongs to a standard which is
415*36dcc4a4SLionel Sambucwell supported.
416*36dcc4a4SLionel SambucUnfortunately the interface is complicated to use and
417*36dcc4a4SLionel Sambucmaintenance of the catalogs is difficult.
418*36dcc4a4SLionel SambucThe implementation also doesn't support different character sets.
419*36dcc4a4SLionel SambucThe
420*36dcc4a4SLionel Sambuc.Xr gettext 3
421*36dcc4a4SLionel Sambucinterface has not been standardized yet, however it is being supported
422*36dcc4a4SLionel Sambucby an increasing number of systems.
423*36dcc4a4SLionel SambucIt also provides many additional tools which make programming and
424*36dcc4a4SLionel Sambuccatalog maintenance much easier.
425*36dcc4a4SLionel Sambuc.Ss Support for Multi-byte Encodings
426*36dcc4a4SLionel SambucSome character sets with multi-byte encodings may be difficult to decode,
427*36dcc4a4SLionel Sambucor may contain state (i.e., adjacent characters are dependent).
428*36dcc4a4SLionel SambucISO C specifies a set of functions using 'wide characters' which can handle
429*36dcc4a4SLionel Sambucmulti-byte encodings properly.
430*36dcc4a4SLionel SambucThe behaviour of these functions is affected
431*36dcc4a4SLionel Sambucby the
432*36dcc4a4SLionel Sambuc.Ev LC_CTYPE
433*36dcc4a4SLionel Sambuccategory of the current locale.
434*36dcc4a4SLionel Sambuc.Pp
435*36dcc4a4SLionel SambucA wide character is specified in ISO C
436*36dcc4a4SLionel Sambucas being a fixed number of bits wide and is stateless.
437*36dcc4a4SLionel SambucThere are two types for wide characters:
438*36dcc4a4SLionel Sambuc.Em wchar_t
439*36dcc4a4SLionel Sambucand
440*36dcc4a4SLionel Sambuc.Em wint_t .
441*36dcc4a4SLionel Sambuc.Em wchar_t
442*36dcc4a4SLionel Sambucis a type which can contain one wide character and operates like 'char'
443*36dcc4a4SLionel Sambuctype does for one character.
444*36dcc4a4SLionel Sambuc.Em wint_t
445*36dcc4a4SLionel Sambuccan contain one wide character or WEOF (wide EOF).
446*36dcc4a4SLionel Sambuc.Pp
447*36dcc4a4SLionel SambucThere are functions that operate on
448*36dcc4a4SLionel Sambuc.Em wchar_t ,
449*36dcc4a4SLionel Sambucand substitute for functions operating on 'char'.
450*36dcc4a4SLionel SambucSee
451*36dcc4a4SLionel Sambuc.Xr wmemchr 3
452*36dcc4a4SLionel Sambucand
453*36dcc4a4SLionel Sambuc.Xr towlower 3
454*36dcc4a4SLionel Sambucfor details.
455*36dcc4a4SLionel SambucThere are some additional functions that operate on
456*36dcc4a4SLionel Sambuc.Em wchar_t .
457*36dcc4a4SLionel SambucSee
458*36dcc4a4SLionel Sambuc.Xr wctype 3
459*36dcc4a4SLionel Sambucand
460*36dcc4a4SLionel Sambuc.Xr wctrans 3
461*36dcc4a4SLionel Sambucfor details.
462*36dcc4a4SLionel Sambuc.Pp
463*36dcc4a4SLionel SambucWide characters should be used for all I/O processing which may rely
464*36dcc4a4SLionel Sambucon locale-specific strings.
465*36dcc4a4SLionel SambucThe two primary issues requiring special use of wide characters are:
466*36dcc4a4SLionel Sambuc.Bl -bullet -offset indent
467*36dcc4a4SLionel Sambuc.It
468*36dcc4a4SLionel SambucAll I/O is performed using multibyte characters.
469*36dcc4a4SLionel SambucInput data is converted into wide characters immediately after
470*36dcc4a4SLionel Sambucreading and data for output is converted from wide characters to
471*36dcc4a4SLionel Sambucmulti-byte encoding immediately before writing.
472*36dcc4a4SLionel SambucConversion is controlled by the
473*36dcc4a4SLionel Sambuc.Xr mbstowcs 3 ,
474*36dcc4a4SLionel Sambuc.Xr mbsrtowcs 3 ,
475*36dcc4a4SLionel Sambuc.Xr wcstombs 3 ,
476*36dcc4a4SLionel Sambuc.Xr wcsrtombs 3 ,
477*36dcc4a4SLionel Sambuc.Xr mblen 3 ,
478*36dcc4a4SLionel Sambuc.Xr mbrlen 3 ,
479*36dcc4a4SLionel Sambucand
480*36dcc4a4SLionel Sambuc.Xr  mbsinit 3 .
481*36dcc4a4SLionel Sambuc.It
482*36dcc4a4SLionel SambucWide characters are used directly for I/O, using
483*36dcc4a4SLionel Sambuc.Xr getwchar 3 ,
484*36dcc4a4SLionel Sambuc.Xr fgetwc 3 ,
485*36dcc4a4SLionel Sambuc.Xr getwc 3 ,
486*36dcc4a4SLionel Sambuc.Xr ungetwc 3 ,
487*36dcc4a4SLionel Sambuc.Xr fgetws 3 ,
488*36dcc4a4SLionel Sambuc.Xr putwchar 3 ,
489*36dcc4a4SLionel Sambuc.Xr fputwc 3 ,
490*36dcc4a4SLionel Sambuc.Xr putwc 3 ,
491*36dcc4a4SLionel Sambucand
492*36dcc4a4SLionel Sambuc.Xr fputws 3 .
493*36dcc4a4SLionel SambucThey are also used for formatted I/O functions for wide characters
494*36dcc4a4SLionel Sambucsuch as
495*36dcc4a4SLionel Sambuc.Xr fwscanf 3 ,
496*36dcc4a4SLionel Sambuc.Xr wscanf 3 ,
497*36dcc4a4SLionel Sambuc.Xr swscanf 3 ,
498*36dcc4a4SLionel Sambuc.Xr fwprintf 3 ,
499*36dcc4a4SLionel Sambuc.Xr wprintf 3 ,
500*36dcc4a4SLionel Sambuc.Xr swprintf 3 ,
501*36dcc4a4SLionel Sambuc.Xr vfwprintf 3 ,
502*36dcc4a4SLionel Sambuc.Xr vwprintf 3 ,
503*36dcc4a4SLionel Sambucand
504*36dcc4a4SLionel Sambuc.Xr vswprintf 3 ,
505*36dcc4a4SLionel Sambucand wide character identifier of %lc, %C, %ls, %S for conventional
506*36dcc4a4SLionel Sambucformatted I/O functions.
507*36dcc4a4SLionel Sambuc.El
508*36dcc4a4SLionel Sambuc.Sh SEE ALSO
509*36dcc4a4SLionel Sambuc.Xr gencat 1 ,
510*36dcc4a4SLionel Sambuc.Xr xfd 1 ,
511*36dcc4a4SLionel Sambuc.Xr xterm 1 ,
512*36dcc4a4SLionel Sambuc.Xr catgets 3 ,
513*36dcc4a4SLionel Sambuc.Xr gettext 3 ,
514*36dcc4a4SLionel Sambuc.Xr nl_langinfo 3 ,
515*36dcc4a4SLionel Sambuc.Xr setlocale 3 ,
516*36dcc4a4SLionel Sambuc.Xr wsfontload 8
517*36dcc4a4SLionel Sambuc.Sh BUGS
518*36dcc4a4SLionel SambucThis man page is incomplete.
519