Blame


1 a31db67d 2004-04-21 devnull #ifndef PLAN9
2 a31db67d 2004-04-21 devnull #include <sys/types.h>
3 a31db67d 2004-04-21 devnull #include <stdio.h>
4 a31db67d 2004-04-21 devnull #include <unistd.h>
5 a31db67d 2004-04-21 devnull #include <stdlib.h>
6 a31db67d 2004-04-21 devnull #include <fcntl.h>
7 a31db67d 2004-04-21 devnull #include <string.h>
8 a31db67d 2004-04-21 devnull #include <errno.h>
9 a31db67d 2004-04-21 devnull #include "plan9.h"
10 a31db67d 2004-04-21 devnull #else /* PLAN9 */
11 a31db67d 2004-04-21 devnull #include <u.h>
12 a31db67d 2004-04-21 devnull #include <libc.h>
13 a31db67d 2004-04-21 devnull #include <bio.h>
14 a31db67d 2004-04-21 devnull #endif /* PLAN9 */
15 a31db67d 2004-04-21 devnull #include "cyrillic.h"
16 90557256 2006-01-19 devnull #include "misc.h"
17 90557256 2006-01-19 devnull #include "ms.h"
18 90557256 2006-01-19 devnull #include "8859.h"
19 a31db67d 2004-04-21 devnull #include "big5.h"
20 a31db67d 2004-04-21 devnull #include "gb.h"
21 a31db67d 2004-04-21 devnull #include "hdr.h"
22 a31db67d 2004-04-21 devnull #include "conv.h"
23 a31db67d 2004-04-21 devnull
24 a31db67d 2004-04-21 devnull void usage(void);
25 a31db67d 2004-04-21 devnull void list(void);
26 a31db67d 2004-04-21 devnull int squawk = 1;
27 a31db67d 2004-04-21 devnull int clean = 0;
28 a31db67d 2004-04-21 devnull int verbose = 0;
29 a31db67d 2004-04-21 devnull long ninput, noutput, nrunes, nerrors;
30 a31db67d 2004-04-21 devnull char *file = "stdin";
31 a31db67d 2004-04-21 devnull char *argv0;
32 a31db67d 2004-04-21 devnull Rune runes[N];
33 a31db67d 2004-04-21 devnull char obuf[UTFmax*N]; /* maximum bloat from N runes */
34 a31db67d 2004-04-21 devnull long tab[NRUNE];
35 a31db67d 2004-04-21 devnull #ifndef PLAN9
36 a31db67d 2004-04-21 devnull extern char version[];
37 a31db67d 2004-04-21 devnull #endif
38 a31db67d 2004-04-21 devnull
39 a31db67d 2004-04-21 devnull void intable(int, long *, struct convert *);
40 a31db67d 2004-04-21 devnull void unicode_in(int, long *, struct convert *);
41 a31db67d 2004-04-21 devnull void unicode_out(Rune *, int, long *);
42 a31db67d 2004-04-21 devnull
43 a31db67d 2004-04-21 devnull int
44 a31db67d 2004-04-21 devnull main(int argc, char **argv)
45 a31db67d 2004-04-21 devnull {
46 a31db67d 2004-04-21 devnull char *from = "utf";
47 a31db67d 2004-04-21 devnull char *to = "utf";
48 a31db67d 2004-04-21 devnull int fd;
49 a31db67d 2004-04-21 devnull int listem = 0;
50 a31db67d 2004-04-21 devnull struct convert *t, *f;
51 a31db67d 2004-04-21 devnull
52 a31db67d 2004-04-21 devnull ARGBEGIN {
53 a31db67d 2004-04-21 devnull case 'c':
54 a31db67d 2004-04-21 devnull clean = 1;
55 a31db67d 2004-04-21 devnull break;
56 a31db67d 2004-04-21 devnull case 'f':
57 536f9b83 2006-05-21 devnull from = EARGF(usage());
58 fa325e9b 2020-01-10 cross break;
59 a31db67d 2004-04-21 devnull case 'l':
60 a31db67d 2004-04-21 devnull listem = 1;
61 a31db67d 2004-04-21 devnull break;
62 a31db67d 2004-04-21 devnull case 's':
63 a31db67d 2004-04-21 devnull squawk = 0;
64 a31db67d 2004-04-21 devnull break;
65 a31db67d 2004-04-21 devnull case 't':
66 536f9b83 2006-05-21 devnull to = EARGF(usage());
67 a31db67d 2004-04-21 devnull break;
68 a31db67d 2004-04-21 devnull case 'v':
69 a31db67d 2004-04-21 devnull verbose = 1;
70 a31db67d 2004-04-21 devnull break;
71 a31db67d 2004-04-21 devnull default:
72 a31db67d 2004-04-21 devnull usage();
73 a31db67d 2004-04-21 devnull break;
74 a31db67d 2004-04-21 devnull } ARGEND
75 a31db67d 2004-04-21 devnull
76 a31db67d 2004-04-21 devnull USED(argc);
77 a31db67d 2004-04-21 devnull if(verbose)
78 a31db67d 2004-04-21 devnull squawk = 1;
79 a31db67d 2004-04-21 devnull if(listem){
80 a31db67d 2004-04-21 devnull list();
81 a31db67d 2004-04-21 devnull EXIT(0, 0);
82 a31db67d 2004-04-21 devnull }
83 a31db67d 2004-04-21 devnull if(!from || !to)
84 a31db67d 2004-04-21 devnull usage();
85 a31db67d 2004-04-21 devnull f = conv(from, 1);
86 a31db67d 2004-04-21 devnull t = conv(to, 0);
87 a31db67d 2004-04-21 devnull #define PROC {if(f->flags&Table)\
88 a31db67d 2004-04-21 devnull intable(fd, (long *)f->data, t);\
89 a31db67d 2004-04-21 devnull else\
90 a31db67d 2004-04-21 devnull ((Infn)(f->fn))(fd, (long *)0, t);}
91 a31db67d 2004-04-21 devnull if(*argv){
92 a31db67d 2004-04-21 devnull while(*argv){
93 a31db67d 2004-04-21 devnull file = *argv;
94 a31db67d 2004-04-21 devnull #ifndef PLAN9
95 a31db67d 2004-04-21 devnull if((fd = open(*argv, 0)) < 0){
96 a31db67d 2004-04-21 devnull EPR "%s: %s: %s\n", argv0, *argv, strerror(errno));
97 a31db67d 2004-04-21 devnull #else /* PLAN9 */
98 a31db67d 2004-04-21 devnull if((fd = open(*argv, OREAD)) < 0){
99 a31db67d 2004-04-21 devnull EPR "%s: %s: %r\n", argv0, *argv);
100 a31db67d 2004-04-21 devnull #endif /* PLAN9 */
101 a31db67d 2004-04-21 devnull EXIT(1, "open failure");
102 a31db67d 2004-04-21 devnull }
103 a31db67d 2004-04-21 devnull PROC
104 a31db67d 2004-04-21 devnull close(fd);
105 a31db67d 2004-04-21 devnull argv++;
106 a31db67d 2004-04-21 devnull }
107 a31db67d 2004-04-21 devnull } else {
108 a31db67d 2004-04-21 devnull fd = 0;
109 a31db67d 2004-04-21 devnull PROC
110 a31db67d 2004-04-21 devnull }
111 a31db67d 2004-04-21 devnull if(verbose)
112 a31db67d 2004-04-21 devnull EPR "%s: %ld input bytes, %ld runes, %ld output bytes (%ld errors)\n", argv0,
113 a31db67d 2004-04-21 devnull ninput, nrunes, noutput, nerrors);
114 a31db67d 2004-04-21 devnull EXIT(((nerrors && squawk)? 1:0), ((nerrors && squawk)? "conversion error":0));
115 a31db67d 2004-04-21 devnull return(0); /* shut up compiler */
116 a31db67d 2004-04-21 devnull }
117 a31db67d 2004-04-21 devnull
118 a31db67d 2004-04-21 devnull void
119 a31db67d 2004-04-21 devnull usage(void)
120 a31db67d 2004-04-21 devnull {
121 a31db67d 2004-04-21 devnull EPR "Usage: %s [-slv] [-f cs] [-t cs] [file ...]\n", argv0);
122 1a8bd157 2006-02-14 devnull verbose = 1;
123 a31db67d 2004-04-21 devnull list();
124 a31db67d 2004-04-21 devnull EXIT(1, "usage");
125 a31db67d 2004-04-21 devnull }
126 a31db67d 2004-04-21 devnull
127 a31db67d 2004-04-21 devnull void
128 a31db67d 2004-04-21 devnull list(void)
129 a31db67d 2004-04-21 devnull {
130 a31db67d 2004-04-21 devnull struct convert *c;
131 a31db67d 2004-04-21 devnull char ch = verbose?'\t':' ';
132 a31db67d 2004-04-21 devnull
133 a31db67d 2004-04-21 devnull #ifndef PLAN9
134 a31db67d 2004-04-21 devnull EPR "%s version = '%s'\n", argv0, version);
135 a31db67d 2004-04-21 devnull #endif
136 a31db67d 2004-04-21 devnull if(verbose)
137 a31db67d 2004-04-21 devnull EPR "character sets:\n");
138 a31db67d 2004-04-21 devnull else
139 a31db67d 2004-04-21 devnull EPR "cs:");
140 a31db67d 2004-04-21 devnull for(c = convert; c->name; c++){
141 a31db67d 2004-04-21 devnull if((c->flags&From) && c[1].name && (strcmp(c[1].name, c->name) == 0)){
142 a31db67d 2004-04-21 devnull EPR "%c%s", ch, c->name);
143 a31db67d 2004-04-21 devnull c++;
144 a31db67d 2004-04-21 devnull } else if(c->flags&Table)
145 a31db67d 2004-04-21 devnull EPR "%c%s", ch, c->name);
146 a31db67d 2004-04-21 devnull else if(c->flags&From)
147 a31db67d 2004-04-21 devnull EPR "%c%s(from)", ch, c->name);
148 a31db67d 2004-04-21 devnull else
149 a31db67d 2004-04-21 devnull EPR "%c%s(to)", ch, c->name);
150 a31db67d 2004-04-21 devnull if(verbose)
151 a31db67d 2004-04-21 devnull EPR "\t%s\n", c->chatter);
152 a31db67d 2004-04-21 devnull }
153 a31db67d 2004-04-21 devnull if(!verbose)
154 a31db67d 2004-04-21 devnull EPR "\n");
155 a31db67d 2004-04-21 devnull }
156 a31db67d 2004-04-21 devnull
157 a31db67d 2004-04-21 devnull struct convert *
158 a31db67d 2004-04-21 devnull conv(char *name, int from)
159 a31db67d 2004-04-21 devnull {
160 a31db67d 2004-04-21 devnull struct convert *c;
161 a31db67d 2004-04-21 devnull
162 a31db67d 2004-04-21 devnull for(c = convert; c->name; c++){
163 536f9b83 2006-05-21 devnull if(cistrcmp(c->name, name) != 0)
164 a31db67d 2004-04-21 devnull continue;
165 a31db67d 2004-04-21 devnull if(c->flags&Table)
166 a31db67d 2004-04-21 devnull return(c);
167 a31db67d 2004-04-21 devnull if(((c->flags&From) == 0) == (from == 0))
168 a31db67d 2004-04-21 devnull return(c);
169 a31db67d 2004-04-21 devnull }
170 a31db67d 2004-04-21 devnull EPR "%s: charset `%s' unknown\n", argv0, name);
171 a31db67d 2004-04-21 devnull EXIT(1, "unknown character set");
172 a31db67d 2004-04-21 devnull return(0); /* just shut the compiler up */
173 a31db67d 2004-04-21 devnull }
174 a31db67d 2004-04-21 devnull
175 a31db67d 2004-04-21 devnull void
176 a31db67d 2004-04-21 devnull swab2(char *b, int n)
177 a31db67d 2004-04-21 devnull {
178 a31db67d 2004-04-21 devnull char *e, p;
179 a31db67d 2004-04-21 devnull
180 a31db67d 2004-04-21 devnull for(e = b+n; b < e; b++){
181 a31db67d 2004-04-21 devnull p = *b;
182 a31db67d 2004-04-21 devnull *b = b[1];
183 a31db67d 2004-04-21 devnull *++b = p;
184 a31db67d 2004-04-21 devnull }
185 a31db67d 2004-04-21 devnull }
186 a31db67d 2004-04-21 devnull
187 a31db67d 2004-04-21 devnull void
188 a31db67d 2004-04-21 devnull unicode_in(int fd, long *notused, struct convert *out)
189 a31db67d 2004-04-21 devnull {
190 c006e984 2010-06-28 rsc u16int ubuf[N];
191 a31db67d 2004-04-21 devnull Rune buf[N];
192 c006e984 2010-06-28 rsc int i, n;
193 a31db67d 2004-04-21 devnull int swabme;
194 a31db67d 2004-04-21 devnull
195 a31db67d 2004-04-21 devnull USED(notused);
196 c006e984 2010-06-28 rsc if(read(fd, (char *)ubuf, 2) != 2)
197 a31db67d 2004-04-21 devnull return;
198 a31db67d 2004-04-21 devnull ninput += 2;
199 c006e984 2010-06-28 rsc switch(ubuf[0])
200 a31db67d 2004-04-21 devnull {
201 a31db67d 2004-04-21 devnull default:
202 c006e984 2010-06-28 rsc buf[0] = ubuf[0];
203 a31db67d 2004-04-21 devnull OUT(out, buf, 1);
204 a31db67d 2004-04-21 devnull case 0xFEFF:
205 a31db67d 2004-04-21 devnull swabme = 0;
206 a31db67d 2004-04-21 devnull break;
207 a31db67d 2004-04-21 devnull case 0xFFFE:
208 a31db67d 2004-04-21 devnull swabme = 1;
209 a31db67d 2004-04-21 devnull break;
210 a31db67d 2004-04-21 devnull }
211 c006e984 2010-06-28 rsc while((n = read(fd, (char *)ubuf, 2*N)) > 0){
212 a31db67d 2004-04-21 devnull ninput += n;
213 536f9b83 2006-05-21 devnull if(swabme)
214 c006e984 2010-06-28 rsc swab2((char *)ubuf, n);
215 c006e984 2010-06-28 rsc for(i=0; i<n/2; i++)
216 c006e984 2010-06-28 rsc buf[i] = ubuf[i];
217 a31db67d 2004-04-21 devnull if(n&1){
218 a31db67d 2004-04-21 devnull if(squawk)
219 a31db67d 2004-04-21 devnull EPR "%s: odd byte count in %s\n", argv0, file);
220 a31db67d 2004-04-21 devnull nerrors++;
221 a31db67d 2004-04-21 devnull if(clean)
222 a31db67d 2004-04-21 devnull n--;
223 536f9b83 2006-05-21 devnull else
224 536f9b83 2006-05-21 devnull buf[n++/2] = Runeerror;
225 a31db67d 2004-04-21 devnull }
226 a31db67d 2004-04-21 devnull OUT(out, buf, n/2);
227 a31db67d 2004-04-21 devnull }
228 a31db67d 2004-04-21 devnull }
229 a31db67d 2004-04-21 devnull
230 a31db67d 2004-04-21 devnull void
231 536f9b83 2006-05-21 devnull unicode_in_be(int fd, long *notused, struct convert *out)
232 536f9b83 2006-05-21 devnull {
233 536f9b83 2006-05-21 devnull int i, n;
234 c006e984 2010-06-28 rsc u16int ubuf[N];
235 536f9b83 2006-05-21 devnull Rune buf[N], r;
236 536f9b83 2006-05-21 devnull uchar *p;
237 536f9b83 2006-05-21 devnull
238 536f9b83 2006-05-21 devnull USED(notused);
239 c006e984 2010-06-28 rsc while((n = read(fd, (char *)ubuf, 2*N)) > 0){
240 536f9b83 2006-05-21 devnull ninput += n;
241 c006e984 2010-06-28 rsc p = (uchar*)ubuf;
242 536f9b83 2006-05-21 devnull for(i=0; i<n/2; i++){
243 536f9b83 2006-05-21 devnull r = *p++<<8;
244 536f9b83 2006-05-21 devnull r |= *p++;
245 536f9b83 2006-05-21 devnull buf[i] = r;
246 536f9b83 2006-05-21 devnull }
247 536f9b83 2006-05-21 devnull if(n&1){
248 536f9b83 2006-05-21 devnull if(squawk)
249 536f9b83 2006-05-21 devnull EPR "%s: odd byte count in %s\n", argv0, file);
250 536f9b83 2006-05-21 devnull nerrors++;
251 536f9b83 2006-05-21 devnull if(clean)
252 536f9b83 2006-05-21 devnull n--;
253 536f9b83 2006-05-21 devnull else
254 536f9b83 2006-05-21 devnull buf[n++/2] = Runeerror;
255 536f9b83 2006-05-21 devnull }
256 536f9b83 2006-05-21 devnull OUT(out, buf, n/2);
257 536f9b83 2006-05-21 devnull }
258 536f9b83 2006-05-21 devnull OUT(out, buf, 0);
259 536f9b83 2006-05-21 devnull }
260 536f9b83 2006-05-21 devnull
261 536f9b83 2006-05-21 devnull void
262 536f9b83 2006-05-21 devnull unicode_in_le(int fd, long *notused, struct convert *out)
263 536f9b83 2006-05-21 devnull {
264 536f9b83 2006-05-21 devnull int i, n;
265 c006e984 2010-06-28 rsc u16int ubuf[N];
266 536f9b83 2006-05-21 devnull Rune buf[N], r;
267 536f9b83 2006-05-21 devnull uchar *p;
268 536f9b83 2006-05-21 devnull
269 536f9b83 2006-05-21 devnull USED(notused);
270 c006e984 2010-06-28 rsc while((n = read(fd, (char *)ubuf, 2*N)) > 0){
271 536f9b83 2006-05-21 devnull ninput += n;
272 c006e984 2010-06-28 rsc p = (uchar*)ubuf;
273 536f9b83 2006-05-21 devnull for(i=0; i<n/2; i++){
274 536f9b83 2006-05-21 devnull r = *p++;
275 536f9b83 2006-05-21 devnull r |= *p++<<8;
276 536f9b83 2006-05-21 devnull buf[i] = r;
277 536f9b83 2006-05-21 devnull }
278 536f9b83 2006-05-21 devnull if(n&1){
279 536f9b83 2006-05-21 devnull if(squawk)
280 536f9b83 2006-05-21 devnull EPR "%s: odd byte count in %s\n", argv0, file);
281 536f9b83 2006-05-21 devnull nerrors++;
282 536f9b83 2006-05-21 devnull if(clean)
283 536f9b83 2006-05-21 devnull n--;
284 536f9b83 2006-05-21 devnull else
285 536f9b83 2006-05-21 devnull buf[n++/2] = Runeerror;
286 536f9b83 2006-05-21 devnull }
287 536f9b83 2006-05-21 devnull OUT(out, buf, n/2);
288 536f9b83 2006-05-21 devnull }
289 536f9b83 2006-05-21 devnull OUT(out, buf, 0);
290 536f9b83 2006-05-21 devnull }
291 536f9b83 2006-05-21 devnull
292 536f9b83 2006-05-21 devnull void
293 a31db67d 2004-04-21 devnull unicode_out(Rune *base, int n, long *notused)
294 a31db67d 2004-04-21 devnull {
295 a31db67d 2004-04-21 devnull static int first = 1;
296 c006e984 2010-06-28 rsc u16int buf[N];
297 c006e984 2010-06-28 rsc int i;
298 a31db67d 2004-04-21 devnull
299 a31db67d 2004-04-21 devnull USED(notused);
300 a31db67d 2004-04-21 devnull nrunes += n;
301 a31db67d 2004-04-21 devnull if(first){
302 c006e984 2010-06-28 rsc u16int x = 0xFEFF;
303 a31db67d 2004-04-21 devnull noutput += 2;
304 a31db67d 2004-04-21 devnull write(1, (char *)&x, 2);
305 a31db67d 2004-04-21 devnull first = 0;
306 536f9b83 2006-05-21 devnull }
307 536f9b83 2006-05-21 devnull noutput += 2*n;
308 c006e984 2010-06-28 rsc for(i=0; i<n; i++)
309 c006e984 2010-06-28 rsc buf[i] = base[i];
310 c006e984 2010-06-28 rsc write(1, (char *)buf, 2*n);
311 536f9b83 2006-05-21 devnull }
312 536f9b83 2006-05-21 devnull
313 536f9b83 2006-05-21 devnull void
314 536f9b83 2006-05-21 devnull unicode_out_be(Rune *base, int n, long *notused)
315 536f9b83 2006-05-21 devnull {
316 536f9b83 2006-05-21 devnull int i;
317 536f9b83 2006-05-21 devnull uchar *p;
318 536f9b83 2006-05-21 devnull Rune r;
319 536f9b83 2006-05-21 devnull
320 536f9b83 2006-05-21 devnull USED(notused);
321 536f9b83 2006-05-21 devnull p = (uchar*)base;
322 536f9b83 2006-05-21 devnull for(i=0; i<n; i++){
323 536f9b83 2006-05-21 devnull r = base[i];
324 536f9b83 2006-05-21 devnull *p++ = r>>8;
325 536f9b83 2006-05-21 devnull *p++ = r;
326 536f9b83 2006-05-21 devnull }
327 536f9b83 2006-05-21 devnull nrunes += n;
328 536f9b83 2006-05-21 devnull noutput += 2*n;
329 536f9b83 2006-05-21 devnull write(1, (char *)base, 2*n);
330 536f9b83 2006-05-21 devnull }
331 536f9b83 2006-05-21 devnull
332 536f9b83 2006-05-21 devnull void
333 536f9b83 2006-05-21 devnull unicode_out_le(Rune *base, int n, long *notused)
334 536f9b83 2006-05-21 devnull {
335 536f9b83 2006-05-21 devnull int i;
336 536f9b83 2006-05-21 devnull uchar *p;
337 536f9b83 2006-05-21 devnull Rune r;
338 536f9b83 2006-05-21 devnull
339 536f9b83 2006-05-21 devnull USED(notused);
340 536f9b83 2006-05-21 devnull p = (uchar*)base;
341 536f9b83 2006-05-21 devnull for(i=0; i<n; i++){
342 536f9b83 2006-05-21 devnull r = base[i];
343 536f9b83 2006-05-21 devnull *p++ = r;
344 536f9b83 2006-05-21 devnull *p++ = r>>8;
345 a31db67d 2004-04-21 devnull }
346 536f9b83 2006-05-21 devnull nrunes += n;
347 a31db67d 2004-04-21 devnull noutput += 2*n;
348 a31db67d 2004-04-21 devnull write(1, (char *)base, 2*n);
349 a31db67d 2004-04-21 devnull }
350 a31db67d 2004-04-21 devnull
351 a31db67d 2004-04-21 devnull void
352 a31db67d 2004-04-21 devnull intable(int fd, long *table, struct convert *out)
353 a31db67d 2004-04-21 devnull {
354 a31db67d 2004-04-21 devnull uchar buf[N];
355 a31db67d 2004-04-21 devnull uchar *p, *e;
356 a31db67d 2004-04-21 devnull Rune *r;
357 a31db67d 2004-04-21 devnull int n;
358 a31db67d 2004-04-21 devnull long c;
359 a31db67d 2004-04-21 devnull
360 a31db67d 2004-04-21 devnull while((n = read(fd, (char *)buf, N)) > 0){
361 a31db67d 2004-04-21 devnull ninput += n;
362 a31db67d 2004-04-21 devnull r = runes;
363 a31db67d 2004-04-21 devnull for(p = buf, e = buf+n; p < e; p++){
364 a31db67d 2004-04-21 devnull c = table[*p];
365 a31db67d 2004-04-21 devnull if(c < 0){
366 a31db67d 2004-04-21 devnull if(squawk)
367 a31db67d 2004-04-21 devnull EPR "%s: bad char 0x%x near byte %ld in %s\n", argv0, *p, ninput+(p-e), file);
368 a31db67d 2004-04-21 devnull nerrors++;
369 a31db67d 2004-04-21 devnull if(clean)
370 a31db67d 2004-04-21 devnull continue;
371 a31db67d 2004-04-21 devnull c = BADMAP;
372 a31db67d 2004-04-21 devnull }
373 a31db67d 2004-04-21 devnull *r++ = c;
374 a31db67d 2004-04-21 devnull }
375 a31db67d 2004-04-21 devnull OUT(out, runes, r-runes);
376 a31db67d 2004-04-21 devnull }
377 536f9b83 2006-05-21 devnull OUT(out, runes, 0);
378 a31db67d 2004-04-21 devnull if(n < 0){
379 a31db67d 2004-04-21 devnull #ifdef PLAN9
380 a31db67d 2004-04-21 devnull EPR "%s: input read: %r\n", argv0);
381 a31db67d 2004-04-21 devnull #else
382 a31db67d 2004-04-21 devnull EPR "%s: input read: %s\n", argv0, strerror(errno));
383 a31db67d 2004-04-21 devnull #endif
384 a31db67d 2004-04-21 devnull EXIT(1, "input read error");
385 a31db67d 2004-04-21 devnull }
386 a31db67d 2004-04-21 devnull }
387 a31db67d 2004-04-21 devnull
388 a31db67d 2004-04-21 devnull void
389 a31db67d 2004-04-21 devnull outtable(Rune *base, int n, long *map)
390 a31db67d 2004-04-21 devnull {
391 a31db67d 2004-04-21 devnull long c;
392 a31db67d 2004-04-21 devnull char *p;
393 a31db67d 2004-04-21 devnull int i;
394 a31db67d 2004-04-21 devnull
395 a31db67d 2004-04-21 devnull nrunes += n;
396 a31db67d 2004-04-21 devnull for(i = 0; i < NRUNE; i++)
397 a31db67d 2004-04-21 devnull tab[i] = -1;
398 a31db67d 2004-04-21 devnull for(i = 0; i < 256; i++)
399 a31db67d 2004-04-21 devnull if(map[i] >= 0)
400 a31db67d 2004-04-21 devnull tab[map[i]] = i;
401 a31db67d 2004-04-21 devnull for(i = 0, p = obuf; i < n; i++){
402 a31db67d 2004-04-21 devnull c = tab[base[i]];
403 a31db67d 2004-04-21 devnull if(c < 0){
404 a31db67d 2004-04-21 devnull if(squawk)
405 a31db67d 2004-04-21 devnull EPR "%s: rune 0x%x not in output cs\n", argv0, base[i]);
406 a31db67d 2004-04-21 devnull nerrors++;
407 a31db67d 2004-04-21 devnull if(clean)
408 a31db67d 2004-04-21 devnull continue;
409 a31db67d 2004-04-21 devnull c = BADMAP;
410 a31db67d 2004-04-21 devnull }
411 a31db67d 2004-04-21 devnull *p++ = c;
412 a31db67d 2004-04-21 devnull }
413 a31db67d 2004-04-21 devnull noutput += p-obuf;
414 a31db67d 2004-04-21 devnull write(1, obuf, p-obuf);
415 a31db67d 2004-04-21 devnull }
416 a31db67d 2004-04-21 devnull
417 a31db67d 2004-04-21 devnull long tabascii[256] =
418 a31db67d 2004-04-21 devnull {
419 a31db67d 2004-04-21 devnull 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
420 a31db67d 2004-04-21 devnull 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,
421 a31db67d 2004-04-21 devnull 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
422 a31db67d 2004-04-21 devnull 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
423 a31db67d 2004-04-21 devnull 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,
424 a31db67d 2004-04-21 devnull 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,
425 a31db67d 2004-04-21 devnull 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,
426 a31db67d 2004-04-21 devnull 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,
427 a31db67d 2004-04-21 devnull -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
428 a31db67d 2004-04-21 devnull -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
429 a31db67d 2004-04-21 devnull -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
430 a31db67d 2004-04-21 devnull -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
431 a31db67d 2004-04-21 devnull -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
432 a31db67d 2004-04-21 devnull -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
433 a31db67d 2004-04-21 devnull -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
434 cbeb0b26 2006-04-01 devnull -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
435 a31db67d 2004-04-21 devnull };
436 a31db67d 2004-04-21 devnull
437 a31db67d 2004-04-21 devnull long tabmsdos[256] = /* from jhelling@cs.ruu.nl (Jeroen Hellingman) */
438 a31db67d 2004-04-21 devnull {
439 a31db67d 2004-04-21 devnull 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
440 a31db67d 2004-04-21 devnull 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,
441 a31db67d 2004-04-21 devnull 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
442 a31db67d 2004-04-21 devnull 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
443 a31db67d 2004-04-21 devnull 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,
444 a31db67d 2004-04-21 devnull 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,
445 a31db67d 2004-04-21 devnull 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,
446 a31db67d 2004-04-21 devnull 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,
447 a31db67d 2004-04-21 devnull 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, /* latin */
448 a31db67d 2004-04-21 devnull 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5,
449 a31db67d 2004-04-21 devnull 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9,
450 a31db67d 2004-04-21 devnull 0x00ff, 0x00d6, 0x00dc, 0x00a2, 0x00a3, 0x00a5, 0x20a7, 0x0192,
451 a31db67d 2004-04-21 devnull 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba,
452 a31db67d 2004-04-21 devnull 0x00bf, 0x2310, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb,
453 a31db67d 2004-04-21 devnull 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, /* forms */
454 a31db67d 2004-04-21 devnull 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510,
455 a31db67d 2004-04-21 devnull 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f,
456 a31db67d 2004-04-21 devnull 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567,
457 fa325e9b 2020-01-10 cross 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b,
458 a31db67d 2004-04-21 devnull 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580,
459 a31db67d 2004-04-21 devnull 0x03b1, 0x00df, 0x0393, 0x03c0, 0x03a3, 0x03c3, 0x00b5, 0x03c4, /* greek */
460 a31db67d 2004-04-21 devnull 0x03a6, 0x0398, 0x2126, 0x03b4, 0x221e, 0x2205, 0x2208, 0x2229,
461 a31db67d 2004-04-21 devnull 0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248, /* math */
462 cbeb0b26 2006-04-01 devnull 0x00b0, 0x2022, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x220e, 0x00a0
463 a31db67d 2004-04-21 devnull };
464 a31db67d 2004-04-21 devnull long tabmsdos2[256] = /* from jhelling@cs.ruu.nl (Jeroen Hellingman) */
465 a31db67d 2004-04-21 devnull {
466 a31db67d 2004-04-21 devnull 0x0000, 0x263a, 0x263b, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022,
467 a31db67d 2004-04-21 devnull 0x25d8, 0x25cb, 0x25d9, 0x2642, 0x2640, 0x266a, 0x266b, 0x263c,
468 a31db67d 2004-04-21 devnull 0x25b6, 0x25c0, 0x2195, 0x203c, 0x00b6, 0x00a7, 0x2043, 0x21a8,
469 a31db67d 2004-04-21 devnull 0x2191, 0x2193, 0x2192, 0x2190, 0x2319, 0x2194, 0x25b2, 0x25bc,
470 a31db67d 2004-04-21 devnull 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
471 a31db67d 2004-04-21 devnull 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
472 a31db67d 2004-04-21 devnull 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,
473 a31db67d 2004-04-21 devnull 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,
474 a31db67d 2004-04-21 devnull 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,
475 a31db67d 2004-04-21 devnull 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,
476 a31db67d 2004-04-21 devnull 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, /* latin */
477 a31db67d 2004-04-21 devnull 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5,
478 a31db67d 2004-04-21 devnull 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9,
479 a31db67d 2004-04-21 devnull 0x00ff, 0x00d6, 0x00dc, 0x00a2, 0x00a3, 0x00a5, 0x20a7, 0x0192,
480 a31db67d 2004-04-21 devnull 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba,
481 a31db67d 2004-04-21 devnull 0x00bf, 0x2310, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb,
482 a31db67d 2004-04-21 devnull 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, /* forms */
483 a31db67d 2004-04-21 devnull 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510,
484 a31db67d 2004-04-21 devnull 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f,
485 a31db67d 2004-04-21 devnull 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567,
486 fa325e9b 2020-01-10 cross 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b,
487 a31db67d 2004-04-21 devnull 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580,
488 a31db67d 2004-04-21 devnull 0x03b1, 0x00df, 0x0393, 0x03c0, 0x03a3, 0x03c3, 0x00b5, 0x03c4, /* greek */
489 a31db67d 2004-04-21 devnull 0x03a6, 0x0398, 0x2126, 0x03b4, 0x221e, 0x2205, 0x2208, 0x2229,
490 a31db67d 2004-04-21 devnull 0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248, /* math */
491 cbeb0b26 2006-04-01 devnull 0x00b0, 0x2022, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x220e, 0x00a0
492 a31db67d 2004-04-21 devnull };
493 a31db67d 2004-04-21 devnull struct convert convert[] =
494 a31db67d 2004-04-21 devnull { /* if two entries have the same name, put the from one first */
495 a31db67d 2004-04-21 devnull { "8859-1", "Latin-1 (Western and Northern Europe including Italian)", Table, (void *)tab8859_1 },
496 a31db67d 2004-04-21 devnull { "8859-2", "Latin-2 (Eastern Europe except Turkey and the Baltic countries)", Table, (void *)tab8859_2 },
497 a31db67d 2004-04-21 devnull { "8859-3", "Latin-3 (Mediterranean, South Africa, Esperanto)", Table, (void *)tab8859_3 },
498 a31db67d 2004-04-21 devnull { "8859-4", "Latin-4 (Scandinavia and the Baltic countries; obsolete)", Table, (void *)tab8859_4 },
499 a31db67d 2004-04-21 devnull { "8859-5", "Part 5 (Cyrillic)", Table, (void *)tab8859_5 },
500 a31db67d 2004-04-21 devnull { "8859-6", "Part 6 (Arabic)", Table, (void *)tab8859_6 },
501 a31db67d 2004-04-21 devnull { "8859-7", "Part 7 (Greek)", Table, (void *)tab8859_7 },
502 a31db67d 2004-04-21 devnull { "8859-8", "Part 8 (Hebrew)", Table, (void *)tab8859_8 },
503 a31db67d 2004-04-21 devnull { "8859-9", "Latin-5 (Turkey, Western Europe except Icelandic and Faroese)", Table, (void *)tab8859_9 },
504 a31db67d 2004-04-21 devnull { "8859-10", "Latin-6 (Northern Europe)", Table, (void *)tab8859_10 },
505 a31db67d 2004-04-21 devnull { "8859-15", "Latin-9 (Western Europe)", Table, (void *)tab8859_15 },
506 35d26aa3 2005-12-26 devnull { "ascii", "7-bit ASCII", Table, (void *)tabascii },
507 35d26aa3 2005-12-26 devnull { "atari", "ATARI-ST character set", Table, (void *)tabatari },
508 a31db67d 2004-04-21 devnull { "av", "Alternativnyj Variant", Table, (void *)tabav },
509 35d26aa3 2005-12-26 devnull { "big5", "Big 5 (HKU)", From|Func, 0, (Fnptr)big5_in },
510 35d26aa3 2005-12-26 devnull { "big5", "Big 5 (HKU)", Func, 0, (Fnptr)big5_out },
511 35d26aa3 2005-12-26 devnull { "ebcdic", "EBCDIC", Table, (void *)tabebcdic }, /* 6f is recommended bad map */
512 35d26aa3 2005-12-26 devnull { "euc-k", "Korean EUC: ASCII+KS C 5601 1987", From|Func, 0, (Fnptr)uksc_in },
513 35d26aa3 2005-12-26 devnull { "euc-k", "Korean EUC: ASCII+KS C 5601 1987", Func, 0, (Fnptr)uksc_out },
514 536f9b83 2006-05-21 devnull { "gb2312", "GB2312-80 (Chinese)", From|Func, 0, (Fnptr)gb_in },
515 536f9b83 2006-05-21 devnull { "gb2312", "GB2312-80 (Chinese)", Func, 0, (Fnptr)gb_out },
516 35d26aa3 2005-12-26 devnull { "html", "HTML", From|Func, 0, (Fnptr)html_in },
517 35d26aa3 2005-12-26 devnull { "html", "HTML", Func, 0, (Fnptr)html_out },
518 536f9b83 2006-05-21 devnull { "ibm437", "IBM Code Page 437 (US)", Table, (void*)tabcp437 },
519 536f9b83 2006-05-21 devnull { "ibm720", "IBM Code Page 720 (Arabic)", Table, (void*)tabcp720 },
520 536f9b83 2006-05-21 devnull { "ibm737", "IBM Code Page 737 (Greek)", Table, (void*)tabcp737 },
521 536f9b83 2006-05-21 devnull { "ibm775", "IBM Code Page 775 (Baltic)", Table, (void*)tabcp775 },
522 536f9b83 2006-05-21 devnull { "ibm850", "IBM Code Page 850 (Multilingual Latin I)", Table, (void*)tabcp850 },
523 536f9b83 2006-05-21 devnull { "ibm852", "IBM Code Page 852 (Latin II)", Table, (void*)tabcp852 },
524 536f9b83 2006-05-21 devnull { "ibm855", "IBM Code Page 855 (Cyrillic)", Table, (void*)tabcp855 },
525 536f9b83 2006-05-21 devnull { "ibm857", "IBM Code Page 857 (Turkish)", Table, (void*)tabcp857 },
526 536f9b83 2006-05-21 devnull { "ibm858", "IBM Code Page 858 (Multilingual Latin I+Euro)", Table, (void*)tabcp858 },
527 536f9b83 2006-05-21 devnull { "ibm862", "IBM Code Page 862 (Hebrew)", Table, (void*)tabcp862 },
528 536f9b83 2006-05-21 devnull { "ibm866", "IBM Code Page 866 (Russian)", Table, (void*)tabcp866 },
529 536f9b83 2006-05-21 devnull { "ibm874", "IBM Code Page 874 (Thai)", Table, (void*)tabcp874 },
530 536f9b83 2006-05-21 devnull { "iso-2022-jp", "alias for jis-kanji (MIME)", From|Func, 0, (Fnptr)jisjis_in },
531 536f9b83 2006-05-21 devnull { "iso-2022-jp", "alias for jis-kanji (MIME)", Func, 0, (Fnptr)jisjis_out },
532 536f9b83 2006-05-21 devnull { "iso-8859-1", "alias for 8859-1 (MIME)", Table, (void *)tab8859_1 },
533 536f9b83 2006-05-21 devnull { "iso-8859-2", "alias for 8859-2 (MIME)", Table, (void *)tab8859_2 },
534 536f9b83 2006-05-21 devnull { "iso-8859-3", "alias for 8859-3 (MIME)", Table, (void *)tab8859_3 },
535 536f9b83 2006-05-21 devnull { "iso-8859-4", "alias for 8859-4 (MIME)", Table, (void *)tab8859_4 },
536 536f9b83 2006-05-21 devnull { "iso-8859-5", "alias for 8859-5 (MIME)", Table, (void *)tab8859_5 },
537 536f9b83 2006-05-21 devnull { "iso-8859-6", "alias for 8859-6 (MIME)", Table, (void *)tab8859_6 },
538 536f9b83 2006-05-21 devnull { "iso-8859-7", "alias for 8859-7 (MIME)", Table, (void *)tab8859_7 },
539 536f9b83 2006-05-21 devnull { "iso-8859-8", "alias for 8859-8 (MIME)", Table, (void *)tab8859_8 },
540 536f9b83 2006-05-21 devnull { "iso-8859-9", "alias for 8859-9 (MIME)", Table, (void *)tab8859_9 },
541 536f9b83 2006-05-21 devnull { "iso-8859-10", "alias for 8859-10 (MIME)", Table, (void *)tab8859_10 },
542 536f9b83 2006-05-21 devnull { "iso-8859-15", "alias for 8859-15 (MIME)", Table, (void *)tab8859_15 },
543 a31db67d 2004-04-21 devnull { "jis", "guesses at the JIS encoding", From|Func, 0, (Fnptr)jis_in },
544 1a8bd157 2006-02-14 devnull { "jis-kanji", "ISO 2022-JP (Japanese)", From|Func, 0, (Fnptr)jisjis_in },
545 1a8bd157 2006-02-14 devnull { "jis-kanji", "ISO 2022-JP (Japanese)", Func, 0, (Fnptr)jisjis_out },
546 35d26aa3 2005-12-26 devnull { "koi8", "KOI-8 (GOST 19769-74)", Table, (void *)tabkoi8 },
547 536f9b83 2006-05-21 devnull { "koi8-r", "alias for koi8 (MIME)", Table, (void *)tabkoi8 },
548 536f9b83 2006-05-21 devnull { "latin1", "alias for 8859-1", Table, (void *)tab8859_1 },
549 90557256 2006-01-19 devnull { "macrom", "Macintosh Standard Roman character set", Table, (void *)tabmacroman },
550 536f9b83 2006-05-21 devnull { "microsoft", "alias for windows1252", Table, (void *)tabcp1252 },
551 a31db67d 2004-04-21 devnull { "ms-kanji", "Microsoft, or Shift-JIS", From|Func, 0, (Fnptr)msjis_in },
552 a31db67d 2004-04-21 devnull { "ms-kanji", "Microsoft, or Shift-JIS", Func, 0, (Fnptr)msjis_out },
553 536f9b83 2006-05-21 devnull { "msdos", "IBM PC (alias for ibm437)", Table, (void *)tabcp437 },
554 536f9b83 2006-05-21 devnull { "msdos2", "IBM PC (ibm437 with graphics in C0)", Table, (void *)tabmsdos2 },
555 a31db67d 2004-04-21 devnull { "next", "NEXTSTEP character set", Table, (void *)tabnextstep },
556 35d26aa3 2005-12-26 devnull { "ov", "Osnovnoj Variant", Table, (void *)tabov },
557 536f9b83 2006-05-21 devnull { "ps2", "IBM PS/2: (alias for ibm850)", Table, (void *)tabcp850 },
558 35d26aa3 2005-12-26 devnull { "sf1", "ISO-646: Finnish/Swedish SF-1 variant", Table, (void *)tabsf1 },
559 35d26aa3 2005-12-26 devnull { "sf2", "ISO-646: Finnish/Swedish SF-2 variant (recommended)", Table, (void *)tabsf2 },
560 536f9b83 2006-05-21 devnull { "tis-620", "Thai+ASCII (TIS 620-1986)", Table, (void *)tabtis620 },
561 536f9b83 2006-05-21 devnull { "tune", "TUNE (Tamil)", From|Func, 0, (Fnptr)tune_in },
562 536f9b83 2006-05-21 devnull { "tune", "TUNE (Tamil)", Func, 0, (Fnptr)tune_out },
563 35d26aa3 2005-12-26 devnull { "ucode", "Russian U-code", Table, (void *)tabucode },
564 35d26aa3 2005-12-26 devnull { "ujis", "EUC-JX: JIS 0208", From|Func, 0, (Fnptr)ujis_in },
565 35d26aa3 2005-12-26 devnull { "ujis", "EUC-JX: JIS 0208", Func, 0, (Fnptr)ujis_out },
566 a31db67d 2004-04-21 devnull { "unicode", "Unicode 1.1", From|Func, 0, (Fnptr)unicode_in },
567 a31db67d 2004-04-21 devnull { "unicode", "Unicode 1.1", Func, 0, (Fnptr)unicode_out },
568 536f9b83 2006-05-21 devnull { "unicode-be", "Unicode 1.1 big-endian", From|Func, 0, (Fnptr)unicode_in_be },
569 536f9b83 2006-05-21 devnull { "unicode-be", "Unicode 1.1 big-endian", Func, 0, (Fnptr)unicode_out_be },
570 536f9b83 2006-05-21 devnull { "unicode-le", "Unicode 1.1 little-endian", From|Func, 0, (Fnptr)unicode_in_le },
571 536f9b83 2006-05-21 devnull { "unicode-le", "Unicode 1.1 little-endian", Func, 0, (Fnptr)unicode_out_le },
572 536f9b83 2006-05-21 devnull { "us-ascii", "alias for ascii (MIME)", Table, (void *)tabascii },
573 35d26aa3 2005-12-26 devnull { "utf", "FSS-UTF a.k.a. UTF-8", From|Func, 0, (Fnptr)utf_in },
574 35d26aa3 2005-12-26 devnull { "utf", "FSS-UTF a.k.a. UTF-8", Func, 0, (Fnptr)utf_out },
575 536f9b83 2006-05-21 devnull { "utf1", "UTF-1 (ISO 10646 Annex A)", From|Func, 0, (Fnptr)isoutf_in },
576 536f9b83 2006-05-21 devnull { "utf1", "UTF-1 (ISO 10646 Annex A)", Func, 0, (Fnptr)isoutf_out },
577 536f9b83 2006-05-21 devnull { "utf-8", "alias for utf (MIME)", From|Func, 0, (Fnptr)utf_in },
578 536f9b83 2006-05-21 devnull { "utf-8", "alias for utf (MIME)", Func, 0, (Fnptr)utf_out },
579 536f9b83 2006-05-21 devnull { "utf-16", "alias for unicode (MIME)", From|Func, 0, (Fnptr)unicode_in },
580 536f9b83 2006-05-21 devnull { "utf-16", "alias for unicode (MIME)", Func, 0, (Fnptr)unicode_out },
581 536f9b83 2006-05-21 devnull { "utf-16be", "alias for unicode-be (MIME)", From|Func, 0, (Fnptr)unicode_in_be },
582 536f9b83 2006-05-21 devnull { "utf-16be", "alias for unicode-be (MIME)", Func, 0, (Fnptr)unicode_out_be },
583 536f9b83 2006-05-21 devnull { "utf-16le", "alias for unicode-le (MIME)", From|Func, 0, (Fnptr)unicode_in_le },
584 536f9b83 2006-05-21 devnull { "utf-16le", "alias for unicode-le (MIME)", Func, 0, (Fnptr)unicode_out_le },
585 35d26aa3 2005-12-26 devnull { "viet1", "Vietnamese VSCII-1 (1993)", Table, (void *)tabviet1 },
586 35d26aa3 2005-12-26 devnull { "viet2", "Vietnamese VSCII-2 (1993)", Table, (void *)tabviet2 },
587 536f9b83 2006-05-21 devnull { "vscii", "Vietnamese VISCII 1.1 (1992)", Table, (void *)tabviscii },
588 536f9b83 2006-05-21 devnull { "windows-1250", "Windows Code Page 1250 (Central Europe)", Table, (void *)tabcp1250 },
589 536f9b83 2006-05-21 devnull { "windows-1251", "Windows Code Page 1251 (Cyrillic)", Table, (void *)tabcp1251 },
590 536f9b83 2006-05-21 devnull { "windows-1252", "Windows Code Page 1252 (Latin I)", Table, (void *)tabcp1252 },
591 536f9b83 2006-05-21 devnull { "windows-1253", "Windows Code Page 1253 (Greek)", Table, (void *)tabcp1253 },
592 536f9b83 2006-05-21 devnull { "windows-1254", "Windows Code Page 1254 (Turkish)", Table, (void *)tabcp1254 },
593 536f9b83 2006-05-21 devnull { "windows-1255", "Windows Code Page 1255 (Hebrew)", Table, (void *)tabcp1255 },
594 536f9b83 2006-05-21 devnull { "windows-1256", "Windows Code Page 1256 (Arabic)", Table, (void *)tabcp1256 },
595 536f9b83 2006-05-21 devnull { "windows-1257", "Windows Code Page 1257 (Baltic)", Table, (void *)tabcp1257 },
596 536f9b83 2006-05-21 devnull { "windows-1258", "Windows Code Page 1258 (Vietnam)", Table, (void *)tabcp1258 },
597 cbeb0b26 2006-04-01 devnull { 0 }
598 a31db67d 2004-04-21 devnull };