1#! /bin/sh
2# Output a system dependent table of character encoding aliases.
3#
4#   Copyright (C) 2000-2003 Free Software Foundation, Inc.
5#
6#   This program is free software; you can redistribute it and/or modify it
7#   under the terms of the GNU Library General Public License as published
8#   by the Free Software Foundation; either version 2, or (at your option)
9#   any later version.
10#
11#   This program is distributed in the hope that it will be useful,
12#   but WITHOUT ANY WARRANTY; without even the implied warranty of
13#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14#   Library General Public License for more details.
15#
16#   You should have received a copy of the GNU Library General Public
17#   License along with this program; if not, write to the Free Software
18#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19#   USA.
20#
21# The table consists of lines of the form
22#    ALIAS  CANONICAL
23#
24# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
25# ALIAS is compared in a case sensitive way.
26#
27# CANONICAL is the GNU canonical name for this character encoding.
28# It must be an encoding supported by libiconv. Support by GNU libc is
29# also desirable. CANONICAL is case insensitive. Usually an upper case
30# MIME charset name is preferred.
31# The current list of GNU canonical charset names is as follows.
32#
33#       name                         used by which systems         a MIME name?
34#   ASCII, ANSI_X3.4-1968     glibc solaris freebsd
35#   ISO-8859-1                glibc aix hpux irix osf solaris freebsd   yes
36#   ISO-8859-2                glibc aix hpux irix osf solaris freebsd   yes
37#   ISO-8859-3                glibc solaris                             yes
38#   ISO-8859-4                osf solaris freebsd                       yes
39#   ISO-8859-5                glibc aix hpux irix osf solaris freebsd   yes
40#   ISO-8859-6                glibc aix hpux solaris                    yes
41#   ISO-8859-7                glibc aix hpux irix osf solaris           yes
42#   ISO-8859-8                glibc aix hpux osf solaris                yes
43#   ISO-8859-9                glibc aix hpux irix osf solaris           yes
44#   ISO-8859-13               glibc
45#   ISO-8859-14               glibc
46#   ISO-8859-15               glibc aix osf solaris freebsd
47#   KOI8-R                    glibc solaris freebsd                     yes
48#   KOI8-U                    glibc freebsd                             yes
49#   KOI8-T                    glibc
50#   CP437                     dos
51#   CP775                     dos
52#   CP850                     aix osf dos
53#   CP852                     dos
54#   CP855                     dos
55#   CP856                     aix
56#   CP857                     dos
57#   CP861                     dos
58#   CP862                     dos
59#   CP864                     dos
60#   CP865                     dos
61#   CP866                     freebsd dos
62#   CP869                     dos
63#   CP874                     woe32 dos
64#   CP922                     aix
65#   CP932                     aix woe32 dos
66#   CP943                     aix
67#   CP949                     osf woe32 dos
68#   CP950                     woe32 dos
69#   CP1046                    aix
70#   CP1124                    aix
71#   CP1125                    dos
72#   CP1129                    aix
73#   CP1250                    woe32
74#   CP1251                    glibc solaris woe32
75#   CP1252                    aix woe32
76#   CP1253                    woe32
77#   CP1254                    woe32
78#   CP1255                    glibc woe32
79#   CP1256                    woe32
80#   CP1257                    woe32
81#   GB2312                    glibc aix hpux irix solaris freebsd       yes
82#   EUC-JP                    glibc aix hpux irix osf solaris freebsd   yes
83#   EUC-KR                    glibc aix hpux irix osf solaris freebsd   yes
84#   EUC-TW                    glibc aix hpux irix osf solaris
85#   BIG5                      glibc aix hpux osf solaris freebsd        yes
86#   BIG5-HKSCS                glibc solaris
87#   GBK                       glibc aix osf solaris woe32 dos
88#   GB18030                   glibc solaris
89#   SHIFT_JIS                 hpux osf solaris freebsd                  yes
90#   JOHAB                     glibc solaris woe32
91#   TIS-620                   glibc aix hpux osf solaris
92#   VISCII                    glibc                                     yes
93#   TCVN5712-1                glibc
94#   GEORGIAN-PS               glibc
95#   HP-ROMAN8                 hpux
96#   HP-ARABIC8                hpux
97#   HP-GREEK8                 hpux
98#   HP-HEBREW8                hpux
99#   HP-TURKISH8               hpux
100#   HP-KANA8                  hpux
101#   DEC-KANJI                 osf
102#   DEC-HANYU                 osf
103#   UTF-8                     glibc aix hpux osf solaris                yes
104#
105# Note: Names which are not marked as being a MIME name should not be used in
106# Internet protocols for information interchange (mail, news, etc.).
107#
108# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
109# must understand both names and treat them as equivalent.
110#
111# The first argument passed to this file is the canonical host specification,
112#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
113# or
114#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
115
116host="$1"
117os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
118echo "# This file contains a table of character encoding aliases,"
119echo "# suitable for operating system '${os}'."
120echo "# It was automatically generated from config.charset."
121# List of references, updated during installation:
122echo "# Packages using this file: "
123case "$os" in
124    linux* | *-gnu*)
125	# With glibc-2.1 or newer, we don't need any canonicalization,
126	# because glibc has iconv and both glibc and libiconv support all
127	# GNU canonical names directly. Therefore, the Makefile does not
128	# need to install the alias file at all.
129	# The following applies only to glibc-2.0.x and older libcs.
130	echo "ISO_646.IRV:1983 ASCII"
131	;;
132    aix*)
133	echo "ISO8859-1 ISO-8859-1"
134	echo "ISO8859-2 ISO-8859-2"
135	echo "ISO8859-5 ISO-8859-5"
136	echo "ISO8859-6 ISO-8859-6"
137	echo "ISO8859-7 ISO-8859-7"
138	echo "ISO8859-8 ISO-8859-8"
139	echo "ISO8859-9 ISO-8859-9"
140	echo "ISO8859-15 ISO-8859-15"
141	echo "IBM-850 CP850"
142	echo "IBM-856 CP856"
143	echo "IBM-921 ISO-8859-13"
144	echo "IBM-922 CP922"
145	echo "IBM-932 CP932"
146	echo "IBM-943 CP943"
147	echo "IBM-1046 CP1046"
148	echo "IBM-1124 CP1124"
149	echo "IBM-1129 CP1129"
150	echo "IBM-1252 CP1252"
151	echo "IBM-eucCN GB2312"
152	echo "IBM-eucJP EUC-JP"
153	echo "IBM-eucKR EUC-KR"
154	echo "IBM-eucTW EUC-TW"
155	echo "big5 BIG5"
156	echo "GBK GBK"
157	echo "TIS-620 TIS-620"
158	echo "UTF-8 UTF-8"
159	;;
160    hpux*)
161	echo "iso88591 ISO-8859-1"
162	echo "iso88592 ISO-8859-2"
163	echo "iso88595 ISO-8859-5"
164	echo "iso88596 ISO-8859-6"
165	echo "iso88597 ISO-8859-7"
166	echo "iso88598 ISO-8859-8"
167	echo "iso88599 ISO-8859-9"
168	echo "iso885915 ISO-8859-15"
169	echo "roman8 HP-ROMAN8"
170	echo "arabic8 HP-ARABIC8"
171	echo "greek8 HP-GREEK8"
172	echo "hebrew8 HP-HEBREW8"
173	echo "turkish8 HP-TURKISH8"
174	echo "kana8 HP-KANA8"
175	echo "tis620 TIS-620"
176	echo "big5 BIG5"
177	echo "eucJP EUC-JP"
178	echo "eucKR EUC-KR"
179	echo "eucTW EUC-TW"
180	echo "hp15CN GB2312"
181	#echo "ccdc ?" # what is this?
182	echo "SJIS SHIFT_JIS"
183	echo "utf8 UTF-8"
184	;;
185    irix*)
186	echo "ISO8859-1 ISO-8859-1"
187	echo "ISO8859-2 ISO-8859-2"
188	echo "ISO8859-5 ISO-8859-5"
189	echo "ISO8859-7 ISO-8859-7"
190	echo "ISO8859-9 ISO-8859-9"
191	echo "eucCN GB2312"
192	echo "eucJP EUC-JP"
193	echo "eucKR EUC-KR"
194	echo "eucTW EUC-TW"
195	;;
196    osf*)
197	echo "ISO8859-1 ISO-8859-1"
198	echo "ISO8859-2 ISO-8859-2"
199	echo "ISO8859-4 ISO-8859-4"
200	echo "ISO8859-5 ISO-8859-5"
201	echo "ISO8859-7 ISO-8859-7"
202	echo "ISO8859-8 ISO-8859-8"
203	echo "ISO8859-9 ISO-8859-9"
204	echo "ISO8859-15 ISO-8859-15"
205	echo "cp850 CP850"
206	echo "big5 BIG5"
207	echo "dechanyu DEC-HANYU"
208	echo "dechanzi GB2312"
209	echo "deckanji DEC-KANJI"
210	echo "deckorean EUC-KR"
211	echo "eucJP EUC-JP"
212	echo "eucKR EUC-KR"
213	echo "eucTW EUC-TW"
214	echo "GBK GBK"
215	echo "KSC5601 CP949"
216	echo "sdeckanji EUC-JP"
217	echo "SJIS SHIFT_JIS"
218	echo "TACTIS TIS-620"
219	echo "UTF-8 UTF-8"
220	;;
221    solaris*)
222	echo "646 ASCII"
223	echo "ISO8859-1 ISO-8859-1"
224	echo "ISO8859-2 ISO-8859-2"
225	echo "ISO8859-3 ISO-8859-3"
226	echo "ISO8859-4 ISO-8859-4"
227	echo "ISO8859-5 ISO-8859-5"
228	echo "ISO8859-6 ISO-8859-6"
229	echo "ISO8859-7 ISO-8859-7"
230	echo "ISO8859-8 ISO-8859-8"
231	echo "ISO8859-9 ISO-8859-9"
232	echo "ISO8859-15 ISO-8859-15"
233	echo "koi8-r KOI8-R"
234	echo "ansi-1251 CP1251"
235	echo "BIG5 BIG5"
236	echo "Big5-HKSCS BIG5-HKSCS"
237	echo "gb2312 GB2312"
238	echo "GBK GBK"
239	echo "GB18030 GB18030"
240	echo "cns11643 EUC-TW"
241	echo "5601 EUC-KR"
242	echo "ko_KR.johap92 JOHAB"
243	echo "eucJP EUC-JP"
244	echo "PCK SHIFT_JIS"
245	echo "TIS620.2533 TIS-620"
246	#echo "sun_eu_greek ?" # what is this?
247	echo "UTF-8 UTF-8"
248	;;
249    freebsd* | os2*)
250	# FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
251	# localcharset.c falls back to using the full locale name
252	# from the environment variables.
253	# Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
254	# reuse FreeBSD's locale data for OS/2.
255	echo "C ASCII"
256	echo "US-ASCII ASCII"
257	for l in la_LN lt_LN; do
258	  echo "$l.ASCII ASCII"
259	done
260	for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
261	         fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
262	         lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
263	  echo "$l.ISO_8859-1 ISO-8859-1"
264	  echo "$l.DIS_8859-15 ISO-8859-15"
265	done
266	for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
267	  echo "$l.ISO_8859-2 ISO-8859-2"
268	done
269	for l in la_LN lt_LT; do
270	  echo "$l.ISO_8859-4 ISO-8859-4"
271	done
272	for l in ru_RU ru_SU; do
273	  echo "$l.KOI8-R KOI8-R"
274	  echo "$l.ISO_8859-5 ISO-8859-5"
275	  echo "$l.CP866 CP866"
276	done
277	echo "uk_UA.KOI8-U KOI8-U"
278	echo "zh_TW.BIG5 BIG5"
279	echo "zh_TW.Big5 BIG5"
280	echo "zh_CN.EUC GB2312"
281	echo "ja_JP.EUC EUC-JP"
282	echo "ja_JP.SJIS SHIFT_JIS"
283	echo "ja_JP.Shift_JIS SHIFT_JIS"
284	echo "ko_KR.EUC EUC-KR"
285	;;
286    netbsd*)
287	echo "646 ASCII"
288	echo "ISO8859-1 ISO-8859-1"
289	echo "ISO8859-2 ISO-8859-2"
290	echo "ISO8859-4 ISO-8859-4"
291	echo "ISO8859-5 ISO-8859-5"
292	echo "ISO8859-15 ISO-8859-15"
293	echo "eucCN GB2312"
294	echo "eucJP EUC-JP"
295	echo "eucKR EUC-KR"
296	echo "eucTW EUC-TW"
297	echo "BIG5 BIG5"
298	echo "SJIS SHIFT_JIS"
299	;;
300    beos*)
301	# BeOS has a single locale, and it has UTF-8 encoding.
302	echo "* UTF-8"
303	;;
304    msdosdjgpp*)
305	# DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
306	# localcharset.c falls back to using the full locale name
307	# from the environment variables.
308	echo "#"
309	echo "# The encodings given here may not all be correct."
310	echo "# If you find that the encoding given for your language and"
311	echo "# country is not the one your DOS machine actually uses, just"
312	echo "# correct it in this file, and send a mail to"
313	echo "# Juan Manuel Guerrero <st001906@hrz1.hrz.tu-darmstadt.de>"
314	echo "# and Bruno Haible <bruno@clisp.org>."
315	echo "#"
316	echo "C ASCII"
317	# ISO-8859-1 languages
318	echo "ca CP850"
319	echo "ca_ES CP850"
320	echo "da CP865"    # not CP850 ??
321	echo "da_DK CP865" # not CP850 ??
322	echo "de CP850"
323	echo "de_AT CP850"
324	echo "de_CH CP850"
325	echo "de_DE CP850"
326	echo "en CP850"
327	echo "en_AU CP850" # not CP437 ??
328	echo "en_CA CP850"
329	echo "en_GB CP850"
330	echo "en_NZ CP437"
331	echo "en_US CP437"
332	echo "en_ZA CP850" # not CP437 ??
333	echo "es CP850"
334	echo "es_AR CP850"
335	echo "es_BO CP850"
336	echo "es_CL CP850"
337	echo "es_CO CP850"
338	echo "es_CR CP850"
339	echo "es_CU CP850"
340	echo "es_DO CP850"
341	echo "es_EC CP850"
342	echo "es_ES CP850"
343	echo "es_GT CP850"
344	echo "es_HN CP850"
345	echo "es_MX CP850"
346	echo "es_NI CP850"
347	echo "es_PA CP850"
348	echo "es_PY CP850"
349	echo "es_PE CP850"
350	echo "es_SV CP850"
351	echo "es_UY CP850"
352	echo "es_VE CP850"
353	echo "et CP850"
354	echo "et_EE CP850"
355	echo "eu CP850"
356	echo "eu_ES CP850"
357	echo "fi CP850"
358	echo "fi_FI CP850"
359	echo "fr CP850"
360	echo "fr_BE CP850"
361	echo "fr_CA CP850"
362	echo "fr_CH CP850"
363	echo "fr_FR CP850"
364	echo "ga CP850"
365	echo "ga_IE CP850"
366	echo "gd CP850"
367	echo "gd_GB CP850"
368	echo "gl CP850"
369	echo "gl_ES CP850"
370	echo "id CP850"    # not CP437 ??
371	echo "id_ID CP850" # not CP437 ??
372	echo "is CP861"    # not CP850 ??
373	echo "is_IS CP861" # not CP850 ??
374	echo "it CP850"
375	echo "it_CH CP850"
376	echo "it_IT CP850"
377	echo "lt CP775"
378	echo "lt_LT CP775"
379	echo "lv CP775"
380	echo "lv_LV CP775"
381	echo "nb CP865"    # not CP850 ??
382	echo "nb_NO CP865" # not CP850 ??
383	echo "nl CP850"
384	echo "nl_BE CP850"
385	echo "nl_NL CP850"
386	echo "nn CP865"    # not CP850 ??
387	echo "nn_NO CP865" # not CP850 ??
388	echo "no CP865"    # not CP850 ??
389	echo "no_NO CP865" # not CP850 ??
390	echo "pt CP850"
391	echo "pt_BR CP850"
392	echo "pt_PT CP850"
393	echo "sv CP850"
394	echo "sv_SE CP850"
395	# ISO-8859-2 languages
396	echo "cs CP852"
397	echo "cs_CZ CP852"
398	echo "hr CP852"
399	echo "hr_HR CP852"
400	echo "hu CP852"
401	echo "hu_HU CP852"
402	echo "pl CP852"
403	echo "pl_PL CP852"
404	echo "ro CP852"
405	echo "ro_RO CP852"
406	echo "sk CP852"
407	echo "sk_SK CP852"
408	echo "sl CP852"
409	echo "sl_SI CP852"
410	echo "sq CP852"
411	echo "sq_AL CP852"
412	echo "sr CP852"    # CP852 or CP866 or CP855 ??
413	echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
414	# ISO-8859-3 languages
415	echo "mt CP850"
416	echo "mt_MT CP850"
417	# ISO-8859-5 languages
418	echo "be CP866"
419	echo "be_BE CP866"
420	echo "bg CP866"    # not CP855 ??
421	echo "bg_BG CP866" # not CP855 ??
422	echo "mk CP866"    # not CP855 ??
423	echo "mk_MK CP866" # not CP855 ??
424	echo "ru CP866"
425	echo "ru_RU CP866"
426	echo "uk CP1125"
427	echo "uk_UA CP1125"
428	# ISO-8859-6 languages
429	echo "ar CP864"
430	echo "ar_AE CP864"
431	echo "ar_DZ CP864"
432	echo "ar_EG CP864"
433	echo "ar_IQ CP864"
434	echo "ar_IR CP864"
435	echo "ar_JO CP864"
436	echo "ar_KW CP864"
437	echo "ar_MA CP864"
438	echo "ar_OM CP864"
439	echo "ar_QA CP864"
440	echo "ar_SA CP864"
441	echo "ar_SY CP864"
442	# ISO-8859-7 languages
443	echo "el CP869"
444	echo "el_GR CP869"
445	# ISO-8859-8 languages
446	echo "he CP862"
447	echo "he_IL CP862"
448	# ISO-8859-9 languages
449	echo "tr CP857"
450	echo "tr_TR CP857"
451	# Japanese
452	echo "ja CP932"
453	echo "ja_JP CP932"
454	# Chinese
455	echo "zh_CN GBK"
456	echo "zh_TW CP950" # not CP938 ??
457	# Korean
458	echo "kr CP949"    # not CP934 ??
459	echo "kr_KR CP949" # not CP934 ??
460	# Thai
461	echo "th CP874"
462	echo "th_TH CP874"
463	# Other
464	echo "eo CP850"
465	echo "eo_EO CP850"
466	;;
467esac
468