bc7706b1f55c2b7e661ecd1522c3aa96bc2ad090
[platform/upstream/glibc.git] / iconvdata / tst-tables.sh
1 #!/bin/sh
2 # Copyright (C) 2000 Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
4 # Contributed by Bruno Haible <haible@clisp.cons.org>, 2000.
5 #
6 # The GNU C Library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Library General Public License as
8 # published by the Free Software Foundation; either version 2 of the
9 # License, or (at your option) any later version.
10 #
11 # The GNU C Library 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 the GNU C Library; see the file COPYING.LIB.  If not,
18 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
20
21 # Checks that the iconv() implementation (in both directions) for the
22 # stateless encodings agrees with the corresponding charmap table.
23
24 common_objpfx=$1
25 objpfx=$2
26
27 status=0
28
29 cat <<EOF |
30   # Single-byte and other "small" encodings come here.
31   # Keep this list in the same order as gconv-modules.
32   #
33   # charset name    table name          comment
34   ASCII             ANSI_X3.4-1968
35   ISO646-GB         BS_4730
36   ISO646-CA         CSA_Z243.4-1985-1
37   ISO646-CA2        CSA_Z243.4-1985-2
38   ISO646-DE         DIN_66003
39   ISO646-DK         DS_2089
40   ISO646-ES         ES
41   ISO646-ES2        ES2
42   ISO646-CN         GB_1988-80
43   ISO646-IT         IT
44   ISO646-JP         JIS_C6220-1969-RO
45   ISO646-JP-OCR-B   JIS_C6229-1984-B
46   ISO646-YU         JUS_I.B1.002
47   ISO646-KR         KSC5636
48   ISO646-HU         MSZ_7795.3
49   ISO646-CU         NC_NC00-10
50   ISO646-FR         NF_Z_62-010
51   ISO646-FR1        NF_Z_62-010_1973
52   ISO646-NO         NS_4551-1
53   ISO646-NO2        NS_4551-2
54   ISO646-PT         PT
55   ISO646-PT2        PT2
56   ISO646-SE         SEN_850200_B
57   ISO646-SE2        SEN_850200_C
58   ISO-8859-1
59   ISO-8859-2
60   ISO-8859-3
61   ISO-8859-4
62   ISO-8859-5
63   ISO-8859-6
64   ISO-8859-7
65   ISO-8859-8
66   ISO-8859-9
67   ISO-8859-10
68   #ISO-8859-11                          No corresponding table, nonstandard
69   ISO-8859-13
70   ISO-8859-14
71   ISO-8859-15
72   ISO-8859-16
73   T.61-8BIT
74   ISO_6937
75   #ISO_6937-2        ISO-IR-90          Handling of combining marks is broken
76   KOI-8
77   KOI8-R
78   LATIN-GREEK
79   LATIN-GREEK-1
80   HP-ROMAN8
81   EBCDIC-AT-DE
82   EBCDIC-AT-DE-A
83   EBCDIC-CA-FR
84   EBCDIC-DK-NO
85   EBCDIC-DK-NO-A
86   EBCDIC-ES
87   EBCDIC-ES-A
88   EBCDIC-ES-S
89   EBCDIC-FI-SE
90   EBCDIC-FI-SE-A
91   EBCDIC-FR
92   EBCDIC-IS-FRISS
93   EBCDIC-IT
94   EBCDIC-PT
95   EBCDIC-UK
96   EBCDIC-US
97   IBM037
98   IBM038
99   IBM256
100   IBM273
101   IBM274
102   IBM275
103   IBM277
104   IBM278
105   IBM280
106   IBM281
107   IBM284
108   IBM285
109   IBM290
110   IBM297
111   IBM420
112   IBM423
113   IBM424
114   IBM437
115   IBM500
116   IBM850
117   IBM851
118   IBM852
119   IBM855
120   IBM857
121   IBM860
122   IBM861
123   IBM862
124   IBM863
125   IBM864
126   IBM865
127   IBM866
128   IBM868
129   IBM869
130   IBM870
131   IBM871
132   IBM875
133   IBM880
134   IBM891
135   IBM903
136   IBM904
137   IBM905
138   IBM918
139   IBM1004
140   IBM1026
141   IBM1047
142   CP1250
143   CP1251
144   CP1252
145   CP1253
146   CP1254
147   CP1255
148   CP1256
149   CP1257
150   CP1258
151   IBM874
152   CP737
153   CP775
154   MACINTOSH
155   IEC_P27-1
156   ASMO_449
157   ISO-IR-99         ANSI_X3.110-1983
158   ISO-IR-139        CSN_369103
159   CWI
160   DEC-MCS
161   ECMA-CYRILLIC
162   ISO-IR-153        GOST_19768-74
163   GREEK-CCITT
164   GREEK7
165   GREEK7-OLD
166   INIS
167   INIS-8
168   INIS-CYRILLIC
169   ISO_2033          ISO_2033-1983
170   ISO_5427
171   ISO_5427-EXT
172   #ISO_5428                             Handling of combining marks is broken
173   ISO_10367-BOX
174   MAC-IS
175   MAC-UK
176   NATS-DANO
177   NATS-SEFI
178   WIN-SAMI-2        SAMI-WS2
179   ISO-IR-197
180   TIS-620
181   KOI8-U
182   #ISIRI-3342                         This charset concept is completely broken
183   #
184   # Multibyte encodings come here
185   #
186   SJIS
187   EUC-KR
188   CP949
189   #JOHAB                                No charmap exists
190   BIG5
191   BIG5HKSCS
192   EUC-JP
193   EUC-CN            GB2312
194   #GBK                                  Converter uses private area characters
195   EUC-TW
196   GB18030
197   #
198   # Stateful encodings not testable this way
199   #
200   #ISO-2022-JP
201   #ISO-2022-JP-2
202   #ISO-2022-KR
203   #ISO-2022-CN
204   #ISO-2022-CN-EXT
205   #
206 EOF
207 while read charset charmap; do
208   if test "$charset" = GB18030; then echo "This might take a while" 1>&2; fi
209   case ${charset} in \#*) continue;; esac
210   echo -n "Testing ${charset}" 1>&2
211   if ./tst-table.sh ${common_objpfx} ${objpfx} ${charset} ${charmap}; then
212     echo 1>&2
213   else
214     echo "failed: ./tst-table.sh ${common_objpfx} ${objpfx} ${charset} ${charmap}"
215     echo " *** FAILED ***" 1>&2
216     exit 1
217   fi
218 done
219
220 exit $?