Add support for FreeBSD. Improve support for HP-UX and IRIX 6.
[gnulib.git] / lib / config.charset
1 #! /bin/sh
2 # Output a system dependent table of character encoding aliases.
3 #
4 #   Copyright (C) 2000 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 solaris freebsd       yes
37 #   ISO-8859-4                solaris                                   yes
38 #   ISO-8859-5                glibc aix hpux irix solaris               yes
39 #   ISO-8859-6                glibc aix hpux solaris                    yes
40 #   ISO-8859-7                glibc aix hpux irix osf solaris           yes
41 #   ISO-8859-8                glibc aix hpux solaris                    yes
42 #   ISO-8859-9                glibc aix hpux irix osf solaris           yes
43 #   ISO-8859-13               glibc
44 #   ISO-8859-15               aix solaris freebsd
45 #   KOI8-R                    glibc solaris freebsd                     yes
46 #   KOI8-U                    glibc                                     yes
47 #   CP850                     aix osf
48 #   CP856                     aix
49 #   CP866                     freebsd
50 #   CP922                     aix
51 #   CP932                     aix
52 #   CP943                     aix
53 #   CP1046                    aix
54 #   CP1124                    aix
55 #   CP1129                    aix
56 #   CP1251                    glibc
57 #   CP1252                    aix
58 #   EUC-CN                    aix hpux irix solaris
59 #   EUC-JP                    aix hpux irix solaris                     yes
60 #   EUC-KR                    aix hpux irix solaris                     yes
61 #   EUC-TW                    aix hpux irix solaris
62 #   BIG5                      aix hpux solaris                          yes
63 #   GBK                       aix
64 #   SJIS                      hpux solaris
65 #   TIS-620                   aix hpux solaris
66 #   HP-ROMAN8                 hpux
67 #   HP-ARABIC8                hpux
68 #   HP-GREEK8                 hpux
69 #   HP-HEBREW8                hpux
70 #   HP-TURKISH8               hpux
71 #   HP-KANA8                  hpux
72 #   UTF-8                     glibc aix hpux solaris                    yes
73 #
74 # Note: Names which are not marked as being a MIME name should not be used in
75 # Internet protocols for information interchange (mail, news, etc.).
76 #
77 # Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
78 # must understand both names and treat them as equivalent.
79 #
80 # The first argument passed to this file is the canonical host specification,
81 #    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
82 # or
83 #    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
84
85 host="$1"
86 os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
87 echo "# This file contains a table of character encoding aliases,"
88 echo "# suitable for operating system '${os}'."
89 echo "# It was automatically generated from config.charset."
90 # List of references, updated during installation:
91 echo "# Packages using this file: "
92 case "$os" in
93     linux* | *-gnu*)
94         # With glibc-2.1 or newer, we don't need any canonicalization,
95         # because glibc has iconv and both glibc and libiconv support all
96         # GNU canonical names directly. Therefore, the Makefile does not
97         # need to install the alias file at all.
98         # The following applies only to glibc-2.0.x and older libcs.
99         echo "ISO_646.IRV:1983 ASCII"
100         ;;
101     aix*)
102         echo "ISO8859-1 ISO-8859-1"
103         echo "ISO8859-2 ISO-8859-2"
104         echo "ISO8859-5 ISO-8859-5"
105         echo "ISO8859-6 ISO-8859-6"
106         echo "ISO8859-7 ISO-8859-7"
107         echo "ISO8859-8 ISO-8859-8"
108         echo "ISO8859-9 ISO-8859-9"
109         echo "ISO8859-15 ISO-8859-15"
110         echo "IBM-850 CP850"
111         echo "IBM-856 CP856"
112         echo "IBM-921 ISO-8859-13"
113         echo "IBM-922 CP922"
114         echo "IBM-932 CP932"
115         echo "IBM-943 CP943"
116         echo "IBM-1046 CP1046"
117         echo "IBM-1124 CP1124"
118         echo "IBM-1129 CP1129"
119         echo "IBM-1252 CP1252"
120         echo "IBM-eucCN EUC-CN"
121         echo "IBM-eucJP EUC-JP"
122         echo "IBM-eucKR EUC-KR"
123         echo "IBM-eucTW EUC-TW"
124         echo "big5 BIG5"
125         echo "GBK GBK"
126         echo "TIS-620 TIS-620"
127         echo "UTF-8 UTF-8"
128         ;;
129     hpux*)
130         echo "iso88591 ISO-8859-1"
131         echo "iso88592 ISO-8859-2"
132         echo "iso88595 ISO-8859-5"
133         echo "iso88596 ISO-8859-6"
134         echo "iso88597 ISO-8859-7"
135         echo "iso88598 ISO-8859-8"
136         echo "iso88599 ISO-8859-9"
137         echo "iso885915 ISO-8859-15"
138         echo "roman8 HP-ROMAN8"
139         echo "arabic8 HP-ARABIC8"
140         echo "greek8 HP-GREEK8"
141         echo "hebrew8 HP-HEBREW8"
142         echo "turkish8 HP-TURKISH8"
143         echo "kana8 HP-KANA8"
144         echo "tis620 TIS-620"
145         echo "big5 BIG5"
146         echo "eucJP EUC-JP"
147         echo "eucKR EUC-KR"
148         echo "eucTW EUC-TW"
149         echo "hp15CN EUC-CN"
150         #echo "ccdc ?" # what is this?
151         echo "SJIS SJIS"
152         echo "utf8 UTF-8"
153         ;;
154     irix*)
155         echo "ISO8859-1 ISO-8859-1"
156         echo "ISO8859-2 ISO-8859-2"
157         echo "ISO8859-5 ISO-8859-5"
158         echo "ISO8859-7 ISO-8859-7"
159         echo "ISO8859-9 ISO-8859-9"
160         echo "eucCN EUC-CN"
161         echo "eucJP EUC-JP"
162         echo "eucKR EUC-KR"
163         echo "eucTW EUC-TW"
164         ;;
165     osf*)
166         echo "ISO8859-1 ISO-8859-1"
167         echo "ISO8859-7 ISO-8859-7"
168         echo "ISO8859-9 ISO-8859-9"
169         echo "cp850 CP850"
170         ;;
171     solaris*)
172         echo "646 ASCII"
173         echo "ISO8859-1 ISO-8859-1"
174         echo "ISO8859-2 ISO-8859-2"
175         echo "ISO8859-4 ISO-8859-4"
176         echo "ISO8859-5 ISO-8859-5"
177         echo "ISO8859-6 ISO-8859-6"
178         echo "ISO8859-7 ISO-8859-7"
179         echo "ISO8859-8 ISO-8859-8"
180         echo "ISO8859-9 ISO-8859-9"
181         echo "ISO8859-15 ISO-8859-15"
182         echo "koi8-r KOI8-R"
183         echo "BIG5 BIG5"
184         echo "gb2312 EUC-CN"
185         echo "cns11643 EUC-TW"
186         echo "5601 EUC-KR"
187         echo "eucJP EUC-JP"
188         echo "PCK SJIS"
189         echo "TIS620.2533 TIS-620"
190         #echo "sun_eu_greek ?" # what is this?
191         echo "UTF-8 UTF-8"
192         ;;
193     freebsd*)
194         # FreeBSD 3.3 doesn't have nl_langinfo(CODESET); therefore
195         # localcharset.c falls back to using the full locale name
196         # from the environment variables.
197         echo "C ASCII"
198         echo "US-ASCII ASCII"
199         for l in lt_LN; do
200           echo "$l.ASCII ASCII"
201         done
202         for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
203                  fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT lt_LN \
204                  nl_BE nl_NL no_NO pt_PT sv_SE; do
205           echo "$l.ISO_8859-1 ISO-8859-1"
206           echo "$l.DIS_8859-15 ISO-8859-15"
207         done
208         for l in hr_HR hu_HU lt_LN pl_PL sl_SI; do
209           echo "$l.ISO_8859-2 ISO-8859-2"
210         done
211         for l in ru_RU ru_SU; do
212           echo "$l.KOI8-R KOI8-R"
213           echo "$l.CP866 CP866"
214         done
215         ;;
216 esac