2 #@ Output a system dependent table of character encoding aliases.
4 # Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
6 # Copyright (C) 2000-2004, 2006-2008 Free Software Foundation, Inc.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along
19 # with this program; if not, write to the Free Software Foundation,
20 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 # The table consists of lines of the form
25 # ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
26 # ALIAS is compared in a case sensitive way.
28 # CANONICAL is the GNU canonical name for this character encoding.
29 # It must be an encoding supported by libiconv. Support by GNU libc is
30 # also desirable. CANONICAL is case insensitive. Usually an upper case
31 # MIME charset name is preferred.
32 # The current list of GNU canonical charset names is as follows.
34 # name MIME? used by which systems
35 # ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin
36 # ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
37 # ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
38 # ISO-8859-3 Y glibc solaris
39 # ISO-8859-4 Y osf solaris freebsd netbsd openbsd darwin
40 # ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
41 # ISO-8859-6 Y glibc aix hpux solaris
42 # ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin
43 # ISO-8859-8 Y glibc aix hpux osf solaris
44 # ISO-8859-9 Y glibc aix hpux irix osf solaris darwin
45 # ISO-8859-13 glibc netbsd openbsd darwin
47 # ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin
48 # KOI8-R Y glibc solaris freebsd netbsd openbsd darwin
49 # KOI8-U Y glibc freebsd netbsd openbsd darwin
62 # CP866 freebsd netbsd openbsd darwin dos
75 # CP1251 glibc solaris netbsd openbsd darwin woe32
82 # GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin
83 # EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin
84 # EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin
85 # EUC-TW glibc aix hpux irix osf solaris netbsd
86 # BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin
87 # BIG5-HKSCS glibc solaris
88 # GBK glibc aix osf solaris woe32 dos
89 # GB18030 glibc solaris netbsd
90 # SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
91 # JOHAB glibc solaris woe32
92 # TIS-620 glibc aix hpux osf solaris
104 # UTF-8 Y glibc aix hpux osf solaris netbsd darwin
106 # Note: Names which are not marked as being a MIME name should not be used in
107 # Internet protocols for information interchange (mail, news, etc.).
109 # Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
110 # must understand both names and treat them as equivalent.
112 # The first argument passed to this file is the canonical host specification,
113 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
115 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
118 os
=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
119 echo "# This file contains a table of character encoding aliases,"
120 echo "# suitable for operating system '${os}'."
121 echo "# It was automatically generated from config.charset."
122 # List of references, updated during installation:
123 echo "# Packages using this file: "
126 # Linux libc5 doesn't have nl_langinfo(CODESET); therefore
127 # localcharset.c falls back to using the full locale name
128 # from the environment variables.
131 for l
in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
132 en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
133 en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
134 es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
135 et_EE eu eu_ES
fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
136 fr_LU ga ga_IE gl gl_ES id id_ID
in in_ID is is_IS it it_CH \
137 it_IT kl kl_GL
nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
140 echo "$l.iso-8859-1 ISO-8859-1"
141 echo "$l.iso-8859-15 ISO-8859-15"
142 echo "$l.iso-8859-15@euro ISO-8859-15"
143 echo "$l@euro ISO-8859-15"
144 echo "$l.cp-437 CP437"
145 echo "$l.cp-850 CP850"
146 echo "$l.cp-1252 CP1252"
147 echo "$l.cp-1252@euro CP1252"
148 #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
149 echo "$l.utf-8 UTF-8"
150 echo "$l.utf-8@euro UTF-8"
152 for l
in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
153 sl_SI sr sr_CS sr_YU
; do
155 echo "$l.iso-8859-2 ISO-8859-2"
156 echo "$l.cp-852 CP852"
157 echo "$l.cp-1250 CP1250"
158 echo "$l.utf-8 UTF-8"
160 for l
in mk mk_MK ru ru_RU
; do
162 echo "$l.iso-8859-5 ISO-8859-5"
163 echo "$l.koi8-r KOI8-R"
164 echo "$l.cp-866 CP866"
165 echo "$l.cp-1251 CP1251"
166 echo "$l.utf-8 UTF-8"
168 for l
in ar ar_SA
; do
170 echo "$l.iso-8859-6 ISO-8859-6"
171 echo "$l.cp-864 CP864"
172 #echo "$l.cp-868 CP868" # not a commonly used encoding
173 echo "$l.cp-1256 CP1256"
174 echo "$l.utf-8 UTF-8"
176 for l
in el el_GR gr gr_GR
; do
178 echo "$l.iso-8859-7 ISO-8859-7"
179 echo "$l.cp-869 CP869"
180 echo "$l.cp-1253 CP1253"
181 echo "$l.cp-1253@euro CP1253"
182 echo "$l.utf-8 UTF-8"
183 echo "$l.utf-8@euro UTF-8"
185 for l
in he he_IL iw iw_IL
; do
187 echo "$l.iso-8859-8 ISO-8859-8"
188 echo "$l.cp-862 CP862"
189 echo "$l.cp-1255 CP1255"
190 echo "$l.utf-8 UTF-8"
192 for l
in tr tr_TR
; do
194 echo "$l.iso-8859-9 ISO-8859-9"
195 echo "$l.cp-857 CP857"
196 echo "$l.cp-1254 CP1254"
197 echo "$l.utf-8 UTF-8"
199 for l
in lt lt_LT lv lv_LV
; do
200 #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
201 echo "$l ISO-8859-13"
203 for l
in ru_UA uk uk_UA
; do
206 for l
in zh zh_CN
; do
207 #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
210 for l
in ja ja_JP ja_JP.EUC
; do
213 for l
in ko ko_KR
; do
216 for l
in th th_TH
; do
219 for l
in fa fa_IR
; do
220 #echo "$l ISIRI-3342" # a broken encoding
221 echo "$l.utf-8 UTF-8"
225 # With glibc-2.1 or newer, we don't need any canonicalization,
226 # because glibc has iconv and both glibc and libiconv support all
227 # GNU canonical names directly. Therefore, the Makefile does not
228 # need to install the alias file at all.
229 # The following applies only to glibc-2.0.x and older libcs.
230 echo "ISO_646.IRV:1983 ASCII"
233 echo "ISO8859-1 ISO-8859-1"
234 echo "ISO8859-2 ISO-8859-2"
235 echo "ISO8859-5 ISO-8859-5"
236 echo "ISO8859-6 ISO-8859-6"
237 echo "ISO8859-7 ISO-8859-7"
238 echo "ISO8859-8 ISO-8859-8"
239 echo "ISO8859-9 ISO-8859-9"
240 echo "ISO8859-15 ISO-8859-15"
243 echo "IBM-921 ISO-8859-13"
247 echo "IBM-1046 CP1046"
248 echo "IBM-1124 CP1124"
249 echo "IBM-1129 CP1129"
250 echo "IBM-1252 CP1252"
251 echo "IBM-eucCN GB2312"
252 echo "IBM-eucJP EUC-JP"
253 echo "IBM-eucKR EUC-KR"
254 echo "IBM-eucTW EUC-TW"
257 echo "TIS-620 TIS-620"
261 echo "iso88591 ISO-8859-1"
262 echo "iso88592 ISO-8859-2"
263 echo "iso88595 ISO-8859-5"
264 echo "iso88596 ISO-8859-6"
265 echo "iso88597 ISO-8859-7"
266 echo "iso88598 ISO-8859-8"
267 echo "iso88599 ISO-8859-9"
268 echo "iso885915 ISO-8859-15"
269 echo "roman8 HP-ROMAN8"
270 echo "arabic8 HP-ARABIC8"
271 echo "greek8 HP-GREEK8"
272 echo "hebrew8 HP-HEBREW8"
273 echo "turkish8 HP-TURKISH8"
274 echo "kana8 HP-KANA8"
275 echo "tis620 TIS-620"
281 #echo "ccdc ?" # what is this?
282 echo "SJIS SHIFT_JIS"
286 echo "ISO8859-1 ISO-8859-1"
287 echo "ISO8859-2 ISO-8859-2"
288 echo "ISO8859-5 ISO-8859-5"
289 echo "ISO8859-7 ISO-8859-7"
290 echo "ISO8859-9 ISO-8859-9"
297 echo "ISO8859-1 ISO-8859-1"
298 echo "ISO8859-2 ISO-8859-2"
299 echo "ISO8859-4 ISO-8859-4"
300 echo "ISO8859-5 ISO-8859-5"
301 echo "ISO8859-7 ISO-8859-7"
302 echo "ISO8859-8 ISO-8859-8"
303 echo "ISO8859-9 ISO-8859-9"
304 echo "ISO8859-15 ISO-8859-15"
307 echo "dechanyu DEC-HANYU"
308 echo "dechanzi GB2312"
309 echo "deckanji DEC-KANJI"
310 echo "deckorean EUC-KR"
316 echo "sdeckanji EUC-JP"
317 echo "SJIS SHIFT_JIS"
318 echo "TACTIS TIS-620"
323 echo "ISO8859-1 ISO-8859-1"
324 echo "ISO8859-2 ISO-8859-2"
325 echo "ISO8859-3 ISO-8859-3"
326 echo "ISO8859-4 ISO-8859-4"
327 echo "ISO8859-5 ISO-8859-5"
328 echo "ISO8859-6 ISO-8859-6"
329 echo "ISO8859-7 ISO-8859-7"
330 echo "ISO8859-8 ISO-8859-8"
331 echo "ISO8859-9 ISO-8859-9"
332 echo "ISO8859-15 ISO-8859-15"
334 echo "ansi-1251 CP1251"
336 echo "Big5-HKSCS BIG5-HKSCS"
339 echo "GB18030 GB18030"
340 echo "cns11643 EUC-TW"
342 echo "ko_KR.johap92 JOHAB"
345 echo "TIS620.2533 TIS-620"
346 #echo "sun_eu_greek ?" # what is this?
350 # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
351 # localcharset.c falls back to using the full locale name
352 # from the environment variables.
353 # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
354 # reuse FreeBSD's locale data for OS/2.
356 echo "US-ASCII ASCII"
357 for l
in la_LN lt_LN
; do
358 echo "$l.ASCII ASCII"
360 for l
in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
361 fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
362 lt_LN nl_BE nl_NL no_NO pt_PT sv_SE
; do
363 echo "$l.ISO_8859-1 ISO-8859-1"
364 echo "$l.DIS_8859-15 ISO-8859-15"
366 for l
in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI
; do
367 echo "$l.ISO_8859-2 ISO-8859-2"
369 for l
in la_LN lt_LT
; do
370 echo "$l.ISO_8859-4 ISO-8859-4"
372 for l
in ru_RU ru_SU
; do
373 echo "$l.KOI8-R KOI8-R"
374 echo "$l.ISO_8859-5 ISO-8859-5"
375 echo "$l.CP866 CP866"
377 echo "uk_UA.KOI8-U KOI8-U"
378 echo "zh_TW.BIG5 BIG5"
379 echo "zh_TW.Big5 BIG5"
380 echo "zh_CN.EUC GB2312"
381 echo "ja_JP.EUC EUC-JP"
382 echo "ja_JP.SJIS SHIFT_JIS"
383 echo "ja_JP.Shift_JIS SHIFT_JIS"
384 echo "ko_KR.EUC EUC-KR"
388 echo "ISO8859-1 ISO-8859-1"
389 echo "ISO8859-2 ISO-8859-2"
390 echo "ISO8859-4 ISO-8859-4"
391 echo "ISO8859-5 ISO-8859-5"
392 echo "ISO8859-7 ISO-8859-7"
393 echo "ISO8859-13 ISO-8859-13"
394 echo "ISO8859-15 ISO-8859-15"
400 echo "SJIS SHIFT_JIS"
404 echo "ISO8859-1 ISO-8859-1"
405 echo "ISO8859-2 ISO-8859-2"
406 echo "ISO8859-4 ISO-8859-4"
407 echo "ISO8859-5 ISO-8859-5"
408 echo "ISO8859-7 ISO-8859-7"
409 echo "ISO8859-13 ISO-8859-13"
410 echo "ISO8859-15 ISO-8859-15"
413 # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
414 # localcharset.c falls back to using the full locale name
415 # from the environment variables.
417 for l
in en_AU en_CA en_GB en_US la_LN
; do
418 echo "$l.US-ASCII ASCII"
420 for l
in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
421 fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
422 nl_NL no_NO pt_PT sv_SE
; do
424 echo "$l.ISO8859-1 ISO-8859-1"
425 echo "$l.ISO8859-15 ISO-8859-15"
428 echo "$l.ISO8859-1 ISO-8859-1"
429 echo "$l.ISO8859-15 ISO-8859-15"
431 for l
in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI
; do
432 echo "$l.ISO8859-2 ISO-8859-2"
434 for l
in la_LN lt_LT
; do
435 echo "$l.ISO8859-4 ISO-8859-4"
438 echo "$l.KOI8-R KOI8-R"
439 echo "$l.ISO8859-5 ISO-8859-5"
440 echo "$l.CP866 CP866"
443 echo "$l.CP1251 CP1251"
445 echo "uk_UA.KOI8-U KOI8-U"
446 echo "zh_TW.BIG5 BIG5"
447 echo "zh_TW.Big5 BIG5"
448 echo "zh_CN.EUC GB2312"
449 echo "ja_JP.EUC EUC-JP"
450 echo "ja_JP.SJIS SHIFT_JIS"
451 echo "ko_KR.EUC EUC-KR"
454 # Darwin 7.5 has nl_langinfo(CODESET), but it is useless:
455 # - It returns the empty string when LANG is set to a locale of the
456 # form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
458 # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
459 # the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
460 # - The documentation says:
461 # "... all code that calls BSD system routines should ensure
462 # that the const *char parameters of these routines are in UTF-8
463 # encoding. All BSD system functions expect their string
464 # parameters to be in UTF-8 encoding and nothing else."
466 # "An additional caveat is that string parameters for files,
467 # paths, and other file-system entities must be in canonical
468 # UTF-8. In a canonical UTF-8 Unicode string, all decomposable
469 # characters are decomposed ..."
470 # but this is not true: You can pass non-decomposed UTF-8 strings
471 # to file system functions, and it is the OS which will convert
472 # them to decomposed UTF-8 before accessing the file system.
473 # - The Apple Terminal application displays UTF-8 by default.
474 # - However, other applications are free to use different encodings:
475 # - xterm uses ISO-8859-1 by default.
476 # - TextEdit uses MacRoman by default.
477 # We prefer UTF-8 over decomposed UTF-8-MAC because one should
478 # minimize the use of decomposed Unicode. Unfortunately, through the
479 # Darwin file system, decomposed UTF-8 strings are leaked into user
480 # space nevertheless.
484 # BeOS and Haiku have a single locale, and it has UTF-8 encoding.
488 # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
489 # localcharset.c falls back to using the full locale name
490 # from the environment variables.
492 echo "# The encodings given here may not all be correct."
493 echo "# If you find that the encoding given for your language and"
494 echo "# country is not the one your DOS machine actually uses, just"
495 echo "# correct it in this file, and send a mail to"
496 echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
497 echo "# and Bruno Haible <bruno@clisp.org>."
500 # ISO-8859-1 languages
503 echo "da CP865" # not CP850 ??
504 echo "da_DK CP865" # not CP850 ??
510 echo "en_AU CP850" # not CP437 ??
515 echo "en_ZA CP850" # not CP437 ??
553 echo "id CP850" # not CP437 ??
554 echo "id_ID CP850" # not CP437 ??
555 echo "is CP861" # not CP850 ??
556 echo "is_IS CP861" # not CP850 ??
564 echo "nb CP865" # not CP850 ??
565 echo "nb_NO CP865" # not CP850 ??
569 echo "nn CP865" # not CP850 ??
570 echo "nn_NO CP865" # not CP850 ??
571 echo "no CP865" # not CP850 ??
572 echo "no_NO CP865" # not CP850 ??
578 # ISO-8859-2 languages
595 echo "sr CP852" # CP852 or CP866 or CP855 ??
596 echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
597 echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
598 # ISO-8859-3 languages
601 # ISO-8859-5 languages
604 echo "bg CP866" # not CP855 ??
605 echo "bg_BG CP866" # not CP855 ??
606 echo "mk CP866" # not CP855 ??
607 echo "mk_MK CP866" # not CP855 ??
612 # ISO-8859-6 languages
626 # ISO-8859-7 languages
629 # ISO-8859-8 languages
632 # ISO-8859-9 languages
640 echo "zh_TW CP950" # not CP938 ??
642 echo "kr CP949" # not CP934 ??
643 echo "kr_KR CP949" # not CP934 ??