forked from KermitProject/ckermit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ckuxla.c
7591 lines (7153 loc) · 270 KB
/
ckuxla.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "ckcsym.h"
#include "ckcdeb.h" /* Includes... */
#include "ckcker.h"
#include "ckucmd.h"
#include "ckcxla.h"
#ifdef NOXFER
#define zdstuff(a)
#endif /* NOXFER */
#ifndef NOCSETS
char *xlav = "Character Set Translation 10.0.044, 23 Sep 2022";
/* C K U X L A */
/* C-Kermit tables and functions supporting character set translation. */
/*
Author: Frank da Cruz <fdc@columbia.edu>,
Columbia University Academic Information Systems, New York City.
Copyright (C) 1985, 2022,
Trustees of Columbia University in the City of New York.
All rights reserved. See the C-Kermit COPYING.TXT file or the
copyright text in the ckcmai.c module for disclaimer and permissions.
Note: the date and version number changed in 2022 but the code hasn't
been touched since 2011 - fdc, Fri Sep 23 20:15:40 2022
*/
/* Character set translation data and functions */
extern int zincnt; /* File i/o macros and variables */
extern char *zinptr;
extern int zoutcnt;
extern char *zoutptr;
extern int byteorder;
extern int xfrxla;
int tslevel = TS_L0; /* Transfer syntax level (0,1,2) */
int tcharset = TC_TRANSP; /* Transfer syntax character set */
int tcs_save = -1; /* For save/restore term charset */
int tcs_transp = 0; /* Term charset is TRANSPARENT flag */
#ifdef CKOUNI
int tcsr = TX_8859_1; /* Remote terminal character set */
#else /* CKOUNI */
int tcsr = FC_USASCII;
#endif /* CKOUNI */
int language = L_USASCII; /* Language */
#ifdef UNICODE
int ucsbom = 1; /* Add BOM to new UCS files? */
int ucsorder = -1; /* Default byte order for UCS files */
int fileorder = -1; /* Byte order of current file */
/* 0 = BE, 1 = LE */
#endif /* UNICODE */
/*
Default local file and terminal character set.
Normally ASCII, but for some systems we know otherwise.
*/
int fcs_save = -1;
#ifdef datageneral /* Data General AOS/VS */
int fcharset = FC_DGMCS; /* uses the DG International set */
int dcset8 = FC_DGMCS;
int dcset7 = FC_USASCII;
int tcsl = FC_DGMCS;
#else
#ifdef NEXT /* The NeXT workstation */
int fcharset = FC_NEXT; /* uses its own 8-bit set */
int dcset8 = FC_NEXT;
int dcset7 = FC_USASCII;
int tcsl = FC_NEXT;
#else
#ifdef MAC /* The Macintosh */
int fcharset = FC_APPQD; /* uses an extended version of */
int dcset8 = FC_APPQD;
int dcset7 = FC_USASCII;
int tcsl = FC_APPQD; /* Apple Quickdraw */
#else
#ifdef AUX
int fcharset = FC_APPQD; /* Ditto for Apple A/UX */
int dcset8 = FC_APPQD;
int dcset7 = FC_USASCII;
int tcsl = FC_APPQD;
#else
#ifdef AMIGA /* The Commodore Amiga */
int fcharset = FC_1LATIN; /* uses Latin-1 */
int dcset8 = FC_1LATIN;
int dcset7 = FC_USASCII;
int tcsl = FC_1LATIN;
#else /* All others */
#ifdef CKOUNI /* OS/2 Unicode */
int fcharset = FC_1LATIN;
int dcset8 = FC_1LATIN;
int dcset7 = FC_USASCII;
int tcsl = TX_8859_1;
int prncs = TX_CP437;
#else /* All others */
int fcharset = FC_USASCII; /* use ASCII by default */
int dcset8 = FC_1LATIN; /* But default 8-bit set is Latin-1 */
int dcset7 = FC_USASCII;
int tcsl = FC_USASCII;
int prncs = FC_CP437;
#endif /* CKOUNI */
#endif /* AMIGA */
#endif /* AUX */
#endif /* MAC */
#endif /* NEXT */
#endif /* datageneral */
int s_cset = XMODE_A; /* SEND charset selection = AUTO */
int r_cset = XMODE_A; /* RECV charset selection = AUTO */
int afcset[MAXFCSETS+1]; /* Character-set associations */
int axcset[MAXTCSETS+1];
int xlatype = XLA_NONE; /* Translation type */
#ifdef UNICODE
#ifdef CK_ANSIC
extern int (*xl_utc[MAXTCSETS+1])(USHORT); /* Unicode to TCS */
extern int (*xl_ufc[MAXFCSETS+1])(USHORT); /* Unicode to FCS */
extern USHORT (*xl_tcu[MAXTCSETS+1])(CHAR); /* TCS to Unicode */
extern USHORT (*xl_fcu[MAXFCSETS+1])(CHAR); /* FCS to Unicode */
#else
extern int (*xl_utc[MAXTCSETS+1])();
extern int (*xl_ufc[MAXFCSETS+1])();
extern USHORT (*xl_tcu[MAXTCSETS+1])();
extern USHORT (*xl_fcu[MAXFCSETS+1])();
#endif /* CK_ANSIC */
#endif /* UNICODE */
/* Bureaucracy section */
_PROTOTYP( CHAR xnel1, (CHAR c) ); /* NeXT to Latin-1 */
_PROTOTYP( CHAR xl143, (CHAR c) ); /* Latin-1 to IBM CP437 */
_PROTOTYP( CHAR xl1as, (CHAR c) ); /* Latin-1 to US ASCII */
_PROTOTYP( CHAR zl1as, (CHAR c) ); /* Latin-1 to US ASCII */
#ifdef CYRILLIC
_PROTOTYP( CHAR xassk, (CHAR c) ); /* ASCII to Short KOI */
_PROTOTYP( CHAR xskcy, (CHAR c) ); /* Short KOI to Latin/Cyrillic */
#endif /* CYRILLIC */
#ifdef LATIN2
_PROTOTYP( CHAR xnel2, (CHAR c) ); /* NeXT to Latin-2 */
_PROTOTYP( CHAR xl243, (CHAR c) ); /* Latin-2 to IBM CP437 */
_PROTOTYP( CHAR xl2as, (CHAR c) ); /* Latin-2 to US ASCII */
_PROTOTYP( CHAR zl2as, (CHAR c) ); /* Latin-2 to US ASCII */
_PROTOTYP( CHAR xl2r8, (CHAR c) ); /* Latin-2 to HP */
_PROTOTYP( CHAR xl2l9, (CHAR c) ); /* Latin-2 to Latin-9 */
_PROTOTYP( CHAR xl9l2, (CHAR c) ); /* Latin-9 to Latin-2 */
_PROTOTYP( CHAR xl2mz, (CHAR c) ); /* Latin-2 to Mazovia */
_PROTOTYP( CHAR xmzl2, (CHAR c) ); /* Mazovia to Latin-2 */
_PROTOTYP( CHAR xl1mz, (CHAR c) ); /* Latin-1 to Mazovia */
_PROTOTYP( CHAR xmzl1, (CHAR c) ); /* Mazovia to Latin-1 */
_PROTOTYP( CHAR xmzl9, (CHAR c) ); /* Latin-9 to Mazovia */
_PROTOTYP( CHAR xl9mz, (CHAR c) ); /* Mazovia to Latin-9 */
#endif /* LATIN2 */
/* Transfer character-set info */
struct csinfo tcsinfo[] = {
/* Name size code designator alphabet keyword */
"TRANSPARENT", 256,TC_TRANSP, "", AL_UNK, "transparent", /* 0 */
"ASCII", 128,TC_USASCII,"", AL_ROMAN,"ascii", /* 1 */
"ISO 8859-1 Latin-1",256,TC_1LATIN, "I6/100",AL_ROMAN,"latin1-iso", /* 2 */
#ifdef LATIN2
"ISO 8859-2 Latin-2",256,TC_2LATIN, "I6/101",AL_ROMAN,"latin2-iso", /* 3 */
#endif /* LATIN2 */
#ifdef CYRILLIC
/* 4 */
"ISO 8859-5 Latin/Cyrillic",256,TC_CYRILL,"I6/144",AL_CYRIL,"cyrillic-iso",
#endif /* CYRILLIC */
#ifdef KANJI
"Japanese EUC",16384,TC_JEUC, "I14/87/13", AL_JAPAN, "euc-jp", /* 5 */
#endif /* KANJI */
#ifdef HEBREW
/* 6 */
"ISO 8859-8 Latin/Hebrew",256,TC_HEBREW,"I6/138",AL_HEBREW,"hebrew-iso",
#endif /* HEBREW */
#ifdef GREEK
"ISO 8859-7 Latin/Greek",256,TC_GREEK,"I6/126",AL_GREEK,"greek-iso", /* 7 */
#endif /* GREEK */
"ISO 8859-15 Latin-9",256,TC_9LATIN,"I6/203",AL_ROMAN,"latin9-iso", /* 8 */
"ISO 10646 / Unicode UCS-2",64000,TC_UCS2,"I162",AL_UNIV,"ucs2", /* 9 */
"ISO 10646 / Unicode UTF-8",64000,TC_UTF8,"I190",AL_UNIV,"utf8", /* 10 */
"",0,0,"",0,""
};
int ntcsets = (sizeof(tcsinfo) / sizeof(struct csinfo)) - 1;
struct keytab tcstab[] = { /* Keyword table for */
"ascii", TC_USASCII, 0, /* SET TRANSFER CHARACTER-SET */
#ifdef CYRILLIC
"cyrillic-iso", TC_CYRILL, 0,
#endif /* CYRILLIC */
#ifdef GREEK
"elot928-greek", TC_GREEK, CM_INV,
#endif /* GREEK */
#ifdef KANJI
"euc-jp", TC_JEUC, 0,
#endif /* KANJI */
#ifdef GREEK
"greek-iso", TC_GREEK, 0,
#endif /* GREEK */
#ifdef HEBREW
"hebrew-iso", TC_HEBREW, 0,
#endif /* HEBREW */
#ifdef UNICODE
"iso-10646-ucs-2", TC_UCS2, CM_INV, /* ISO 10646 / Unicode UCS-2 */
#endif /* UNICODE */
"iso-8859-1", TC_1LATIN, CM_INV, /* ISO Latin Alphabet 1 */
"iso-8859-15", TC_9LATIN, CM_INV, /* ISO Latin Alphabet 9 (yes) */
"iso-8859-2", TC_2LATIN, CM_INV, /* ISO Latin Alphabet 2 */
#ifdef CYRILLIC
"iso-8859-5", TC_CYRILL, CM_INV, /* ISO Latin/Cyrillic Alphabet */
#endif /* CYRILLIC */
#ifdef GREEK
"iso-8859-7", TC_GREEK, CM_INV, /* ISO 8859-7 Latin/Greek */
#endif /* GREEK */
#ifdef HEBREW
"iso-8859-8", TC_HEBREW, CM_INV, /* ISO Latin/Hebrew */
#endif /* HEBREW */
#ifdef KANJI
"japanese-euc", TC_JEUC, CM_INV,
#endif /* KANJI */
"l", TC_1LATIN, CM_ABR|CM_INV,
"la", TC_1LATIN, CM_ABR|CM_INV,
"lat", TC_1LATIN, CM_ABR|CM_INV,
"lati", TC_1LATIN, CM_ABR|CM_INV,
"latin", TC_1LATIN, CM_ABR|CM_INV,
"latin1-iso", TC_1LATIN, 0,
#ifdef LATIN2
"latin2-iso", TC_2LATIN, 0,
#endif /* LATIN2 */
"latin9-iso", TC_9LATIN, 0,
"transparent", TC_TRANSP, 0,
#ifdef UNICODE
"ucs2", TC_UCS2, 0,
#endif /* UNICODE */
"us-ascii", TC_USASCII, CM_INV,
"usascii", TC_USASCII, CM_INV,
#ifdef UNICODE
"utf-8", TC_UTF8, CM_INV,
"utf8", TC_UTF8, 0,
#endif /* UNICODE */
"", 0, 0
};
int ntcs = (sizeof(tcstab) / sizeof(struct keytab)) - 1;
/* File character set information structure, indexed by character set code, */
/* as defined in ckuxla.h. This table must be in order of file character */
/* set number! */
struct csinfo fcsinfo[] = { /* File character set information... */
/* Descriptive Name Size Designator */
"US ASCII", 128, FC_USASCII, NULL, AL_ROMAN, "ascii",
"British/UK ISO-646", 128, FC_UKASCII, NULL, AL_ROMAN, "british",
"Dutch ISO-646", 128, FC_DUASCII, NULL, AL_ROMAN, "dutch",
"Finnish ISO-646", 128, FC_FIASCII, NULL, AL_ROMAN, "finnish",
"French ISO-646", 128, FC_FRASCII, NULL, AL_ROMAN, "french",
"Canadian-French NRC", 128, FC_FCASCII, NULL, AL_ROMAN, "canadian-french",
"German ISO-646", 128, FC_GEASCII, NULL, AL_ROMAN, "german",
"Hungarian ISO-646", 128, FC_HUASCII, NULL, AL_ROMAN, "hungarian",
"Italian ISO-646", 128, FC_ITASCII, NULL, AL_ROMAN, "italian",
"Norwegian/Danish ISO-646",128,FC_NOASCII,NULL,AL_ROMAN,"norwegian/danish",
"Portuguese ISO-646", 128, FC_POASCII, NULL, AL_ROMAN,"portuguese",
"Spanish ISO-646", 128, FC_SPASCII, NULL, AL_ROMAN, "spanish",
"Swedish ISO-646", 128, FC_SWASCII, NULL, AL_ROMAN, "swedish",
"Swiss NRC", 128, FC_CHASCII, NULL, AL_ROMAN, "swiss",
"ISO 8859-1 Latin-1", 256, FC_1LATIN, NULL, AL_ROMAN,"latin1-iso",
"ISO 8859-2 Latin-2", 256, FC_2LATIN, NULL, AL_ROMAN,"latin2-iso",
"DEC Multinational", 256, FC_DECMCS, NULL,AL_ROMAN,"dec-multinational",
"NeXT Multinational", 256, FC_NEXT, NULL,AL_ROMAN,"next-multinational",
"PC Code Page 437", 256, FC_CP437, NULL, AL_ROMAN,"cp437",
"PC Code Page 850", 256, FC_CP850, NULL, AL_ROMAN,"cp850",
"PC Code Page 852", 256, FC_CP852, NULL, AL_ROMAN,"cp852",
"Apple Macintosh Latin", 256, FC_APPQD, NULL, AL_ROMAN,"macintosh-latin",
"Data General International",256,FC_DGMCS,NULL,AL_ROMAN,"dg-international",
"Hewlett Packard Roman8", 256, FC_HPR8, NULL, AL_ROMAN, "hp-roman8",
"ISO 8859-5 Latin/Cyrillic", 256, FC_CYRILL, NULL, AL_CYRIL,"cyrillic-iso",
"CP866 Cyrillic", 256, FC_CP866, NULL, AL_CYRIL,"cp866",
"Short KOI", 128, FC_KOI7, NULL, AL_CYRIL,"short-koi",
"Old KOI-8 Cyrillic", 256, FC_KOI8, NULL, AL_CYRIL,"koi8-cyrillic",
"Japanese JIS7", 16384, FC_JIS7, NULL, AL_JAPAN, "jis7-kanji",
"Japanese Shift JIS", 16384, FC_SHJIS, NULL, AL_JAPAN, "shift-jis-kanji",
"Japanese EUC", 16384, FC_JEUC, NULL, AL_JAPAN, "euc-jp",
"Japanese DEC Kanji", 16384, FC_JDEC, NULL, AL_JAPAN, "dec-kanji",
"Hebrew-7 DEC", 128, FC_HE7, NULL, AL_HEBREW, "hebrew-7",
"ISO 8859-8 Latin/Hebrew",256, FC_HEBREW, NULL, AL_HEBREW, "hebrew-iso",
"CP862 Hebrew", 256, FC_CP862, NULL, AL_HEBREW, "cp862-hebrew",
"ELOT 927 Greek", 128, FC_ELOT, NULL, AL_GREEK, "elot927-greek",
"ISO 8859-7 Latin/Greek", 256, FC_GREEK, NULL, AL_GREEK, "greek-iso",
"CP869 Greek", 256, FC_CP869, NULL, AL_GREEK, "cp869-greek",
"ISO 8859-15 Latin-9", 256, FC_9LATIN, NULL, AL_ROMAN, "latin9-iso",
"PC Code Page 858", 256, FC_CP850, NULL, AL_ROMAN, "cp858",
"PC Code Page 855", 256, FC_CP855, NULL, AL_CYRIL, "cp855-cyrillic",
"Windows Code Page 1251", 256, FC_CP1251, NULL, AL_CYRIL, "cp1251-cyrillic",
"Bulgarian PC Code Page", 256, FC_BULGAR, NULL, AL_CYRIL, "bulgaria-pc",
"Windows Code Page 1250", 256, FC_CP1250, NULL, AL_ROMAN, "cp1250",
"Polish Mazovia PC Code Page", 256, FC_MAZOVIA, NULL, AL_ROMAN, "mazovia-pc",
"ISO 10646 / Unicode UCS-2", 64000, FC_UCS2, NULL, AL_UNIV, "ucs2",
"ISO 10646 / Unicode UTF-8", 64000, FC_UCS2, NULL, AL_UNIV, "utf8",
"KOI8-R Russian+Boxdrawing",256, FC_KOI8R, NULL, AL_CYRIL,"koi8r",
"KOI8-U Ukrainian+Boxdrawing",256,FC_KOI8U, NULL, AL_CYRIL,"koi8u",
"Windows Code Page 1252", 256, FC_CP1252, NULL, AL_ROMAN, "cp1252",
"",0,0,NULL,0,NULL
};
/* Local file character sets */
/* Includes 7-bit National Replacement Character Sets of ISO 646 */
/* Plus ISO Latin-1, DEC Multinational Character Set (MCS), NeXT char set, */
/* Various PC and Windows code pages, etc. */
/* As of C-Kermit 9.0 MIME names are included as invisible synomyms for */
/* those character sets that have MIME names. */
struct keytab fcstab[] = { /* Keyword table for 'set file character-set' */
/*
IMPORTANT: This table is replicated below as ttcstab (terminal character
set table). The only differences are the addition of TRANSPARENT
and the removal of the Kanji sets, which are not supported for terminal
emulation. If you make changes to this table, also change ttcstab.
*/
/* Keyword Value Flags */
"apple-quickdraw", FC_APPQD, CM_INV, /* Apple Quickdraw */
"ascii", FC_USASCII, 0, /* ASCII */
"british", FC_UKASCII, 0, /* British NRC */
"bulgaria-pc", FC_BULGAR, 0, /* Bulgarian PC Code Page */
"canadian-french", FC_FCASCII, 0, /* French Canadian NRC */
#ifdef LATIN2
"cp1250", FC_CP1250, 0, /* Windows CP 1250 */
#endif /* LATIN2 */
#ifdef CYRILLIC
"cp1251-cyrillic", FC_CP1251, 0, /* Windows CP 1251 */
#endif /* CYRILLIC */
"cp1252", FC_CP1252, 0, /* Windows CP 1252 */
"cp437", FC_CP437, 0, /* PC CP437 */
"cp850", FC_CP850, 0, /* PC CP850 */
#ifdef LATIN2
"cp852", FC_CP852, 0, /* PC CP852 */
#endif /* LATIN2 */
#ifdef CYRILLIC
"cp855-cyrillic", FC_CP855, 0, /* PC CP855 */
#endif /* CYRILLIC */
"cp858", FC_CP858, 0, /* PC CP858 */
#ifdef HEBREW
"cp862-hebrew", FC_CP862, 0, /* PC CP862 */
#endif /* HEBREW */
#ifdef CYRILLIC
"cp866-cyrillic", FC_CP866, 0, /* CP866 Cyrillic */
#endif /* CYRILLIC */
#ifdef GREEK
"cp869-greek", FC_CP869, 0, /* CP869 Greek */
#endif /* GREEK */
#ifdef CYRILLIC
"cyrillic-iso", FC_CYRILL, 0, /* ISO Latin/Cyrillic Alphabet */
#endif /* CYRILLIC */
"danish", FC_NOASCII, 0, /* Norwegian and Danish NRC */
#ifdef KANJI
"dec-kanji", FC_JDEC, 0, /* Japanese DEC Kanji */
#endif /* KANJI */
"dec-mcs", FC_DECMCS, CM_INV, /* DEC multinational char set */
"dec-multinational", FC_DECMCS, 0, /* DEC multinational character set */
"dg-international", FC_DGMCS, 0, /* Data General multinational */
"dutch", FC_DUASCII, 0, /* Dutch NRC */
#ifdef GREEK
"elot927-greek", FC_ELOT, 0, /* ELOT 927 Greek */
"elot928-greek", FC_GREEK, 0, /* Same as ISO 8859-7 Latin/Greek */
#endif /* GREEK */
#ifdef KANJI
"euc-jp", FC_JEUC, 0, /* Japanese EUC */
#endif /* KANJI */
"finnish", FC_FIASCII, 0, /* Finnish NRC */
"french", FC_FRASCII, 0, /* French NRC */
"fr-canadian", FC_FCASCII, CM_INV, /* French Canadian NRC */
"german", FC_GEASCII, 0, /* German NRC */
#ifdef GREEK
"greek-iso", FC_GREEK, 0, /* ISO 8859-7 Latin/Greek */
#endif /* GREEK */
#ifdef HEBREW
"he", FC_HEBREW, CM_ABR|CM_INV,
"heb", FC_HEBREW, CM_ABR|CM_INV,
"hebr", FC_HEBREW, CM_ABR|CM_INV,
"hebre", FC_HEBREW, CM_ABR|CM_INV,
"hebrew", FC_HEBREW, CM_ABR|CM_INV,
"hebrew-7", FC_HE7, 0, /* DEC 7-Bit Hebrew */
"hebrew-iso", FC_HEBREW, 0, /* ISO Latin/Hebrew */
#endif /* HEBREW */
"hp-roman8", FC_HPR8, 0, /* Hewlett Packard Roman8 */
"hungarian", FC_HUASCII, 0, /* Hungarian NRC */
"ibm437", FC_CP437, CM_INV, /* PC CP437 */
"ibm850", FC_CP850, CM_INV, /* PC CP850 (not in MIME) */
#ifdef LATIN2
"ibm852", FC_CP852, CM_INV, /* PC CP852 */
#endif /* LATIN2 */
#ifdef CYRILLIC
"ibm855", FC_CP855, CM_INV, /* PC CP855 */
#endif /* CYRILLIC */
"ibm858", FC_CP858, CM_INV, /* PC CP858 (not in MIME) */
#ifdef HEBREW
"ibm862", FC_CP862, CM_INV, /* PC CP862 (not in MIME) */
#endif /* HEBREW */
#ifdef CYRILLIC
"ibm866", FC_CP866, CM_INV, /* CP866 Cyrillic */
#endif /* CYRILLIC */
#ifdef GREEK
"ibm869", FC_CP869, CM_INV, /* CP869 Greek */
#endif /* GREEK */
#ifdef UNICODE
"iso-10646-ucs-2", FC_UCS2, CM_INV, /* ISO 10646 / Unicode UCS-2 */
#endif /* UNICODE */
"iso-8859-1", FC_1LATIN, CM_INV, /* ISO Latin Alphabet 1 */
"iso-8859-15", FC_9LATIN, CM_INV, /* ISO Latin Alphabet 9 (yes) */
"iso-8859-2", FC_2LATIN, CM_INV, /* ISO Latin Alphabet 2 */
#ifdef CYRILLIC
"iso-8859-5", FC_CYRILL, CM_INV, /* ISO Latin/Cyrillic Alphabet */
#endif /* CYRILLIC */
#ifdef GREEK
"iso-8859-7", FC_GREEK, CM_INV, /* ISO 8859-7 Latin/Greek */
#endif /* GREEK */
#ifdef HEBREW
"iso-8859-8", FC_HEBREW, CM_INV, /* ISO Latin/Hebrew */
#endif /* HEBREW */
#ifdef KANJI
"iso2022jp-kanji", FC_JIS7, CM_INV, /* Synonym for JIS-7 */
#endif /* KANJI */
"iso646-gb", FC_UKASCII, CM_INV, /* British NRC */
"iso646-ca", FC_FCASCII, CM_INV, /* French Canadian NRC */
"iso646-de", FC_GEASCII, CM_INV, /* German NRC */
"iso646-dk", FC_NOASCII, CM_INV, /* Norwegian and Danish NRC */
"iso646-es", FC_SPASCII, CM_INV, /* Spanish NRC */
"iso646-fi", FC_FIASCII, CM_INV, /* Finnish NRC */
"iso646-fr", FC_FRASCII, CM_INV, /* French NRC */
"iso646-hu", FC_HUASCII, CM_INV, /* Hungarian NRC */
"iso646-it", FC_ITASCII, CM_INV, /* Italian NRC */
"iso646-no", FC_NOASCII, CM_INV, /* Norwegian and Danish NRC */
"iso646-po", FC_POASCII, CM_INV, /* Portuguese NRC */
"iso646-se", FC_SWASCII, CM_INV, /* Swedish NRC */
"italian", FC_ITASCII, CM_INV, /* Italian NRC */
#ifdef KANJI
"japanese-euc", FC_JEUC, CM_INV, /* Japanese EUC */
"jis7-kanji", FC_JIS7, 0, /* Japanese JIS7 7bit code */
#endif /* KANJI */
#ifdef CYRILLIC
"k", FC_KOI8, CM_ABR|CM_INV,
"ko", FC_KOI8, CM_ABR|CM_INV,
"koi", FC_KOI8, CM_ABR|CM_INV,
"koi7", FC_KOI7, 0, /* Short KOI Cyrillic */
"koi8", FC_KOI8, 0, /* Old KOI-8 Cyrillic */
"koi8-e", FC_KOI8, CM_INV, /* Old KOI-8 Cyrillic */
"koi8-cyrillic", FC_KOI8, CM_INV,
"koi8-r", FC_KOI8R, CM_INV, /* KOI8-R RFC1489 */
"koi8-u", FC_KOI8U, CM_INV, /* KOI8-U RFC2319 */
"koi8r", FC_KOI8R, 0, /* KOI8-R RFC1489 */
"koi8u", FC_KOI8U, 0, /* KOI8-U RFC2319 */
#endif /* CYRILLIC */
"l", FC_1LATIN, CM_ABR|CM_INV,
"la", FC_1LATIN, CM_ABR|CM_INV,
"lat", FC_1LATIN, CM_ABR|CM_INV,
"lati", FC_1LATIN, CM_ABR|CM_INV,
"latin", FC_1LATIN, CM_ABR|CM_INV,
"latin1-iso", FC_1LATIN, 0, /* ISO Latin Alphabet 1 */
#ifdef LATIN2
"latin2-iso", FC_2LATIN, 0, /* ISO Latin Alphabet 2 */
#endif /* LATIN2 */
"latin9-iso", FC_9LATIN, 0, /* ISO Latin Alphabet 9 */
"macintosh-latin", FC_APPQD, 0, /* "Extended Mac Latin" */
#ifdef LATIN2
"mazovia-pc", FC_MAZOVIA, 0, /* Polish Mazovia PC code page */
#endif /* LATIN2 */
"next-multinational", FC_NEXT, 0, /* NeXT workstation */
"norwegian", FC_NOASCII, 0, /* Norwegian and Danish NRC */
"portuguese", FC_POASCII, 0, /* Portuguese NRC */
#ifdef KANJI
"shift-jis-kanji", FC_SHJIS, 0, /* Japanese Kanji Shift-JIS */
"shift_jis", FC_SHJIS, CM_INV, /* Japanese Kanji Shift-JIS */
#endif /* KANJI */
#ifdef CYRILLIC
"short-koi", FC_KOI7, 0, /* Short KOI Cyrillic */
#endif /* CYRILLIC */
"spanish", FC_SPASCII, 0, /* Spanish NRC */
"swedish", FC_SWASCII, 0, /* Swedish NRC */
"swiss", FC_CHASCII, 0, /* Swiss NRC */
#ifdef UNICODE
"ucs2", FC_UCS2, 0, /* ISO 10646 / Unicode UCS-2 */
#endif /* UNICODE */
"us-ascii", FC_USASCII, CM_INV, /* MIME */
"usascii", FC_USASCII, CM_INV,
#ifdef UNICODE
"utf-8", FC_UTF8, CM_INV, /* ISO 10646 / Unicode UTF-8 */
"utf8", FC_UTF8, 0, /* ISO 10646 / Unicode UTF-8 */
#endif /* UNICODE */
#ifdef LATIN2
"windows-1250", FC_CP1250, CM_INV, /* Windows CP 1250 */
#endif /* LATIN2 */
#ifdef CYRILLIC
"windows-1251", FC_CP1251, CM_INV, /* Windows CP 1251 */
#endif /* CYRILLIC */
"windows-1252", FC_CP1252, CM_INV, /* Windows CP 1252 */
"", 0, 0
};
int nfilc = (sizeof(fcstab) / sizeof(struct keytab)) - 1;
struct keytab ttcstab[] = { /* Keyword table for SET TERMINAL CHARACTER-SET */
/*
IMPORTANT: This table is a replica of fcstab, immediately above, with the
addition of TRANSPARENT and deletion of the Japanese sets. If you make
changes to this table, make the corresponding changes to fcstab.
*/
/* Keyword Value Flags */
"apple-quickdraw", FC_APPQD, CM_INV, /* Apple Quickdraw */
"ascii", FC_USASCII, 0, /* ASCII */
"british", FC_UKASCII, 0, /* British NRC */
"bulgaria-pc", FC_BULGAR, 0, /* Bulgarian PC Code Page */
"canadian-french", FC_FCASCII, 0, /* French Canadian NRC */
#ifdef LATIN2
"cp1250", FC_CP1250, 0, /* Windows CP 1250 */
#endif /* LATIN2 */
#ifdef CYRILLIC
"cp1251-cyrillic", FC_CP1251, 0, /* Windows CP 1251 */
#endif /* CYRILLIC */
"cp1252", FC_CP1252, 0, /* Windows CP 1252 */
"cp437", FC_CP437, 0, /* PC CP437 */
"cp850", FC_CP850, 0, /* PC CP850 */
#ifdef LATIN2
"cp852", FC_CP852, 0, /* PC CP852 */
#endif /* LATIN2 */
#ifdef CYRILLIC
"cp855-cyrillic", FC_CP855, 0, /* PC CP855 */
#endif /* CYRILLIC */
"cp858", FC_CP858, 0, /* PC CP858 */
#ifdef HEBREW
"cp862-hebrew", FC_CP862, 0, /* PC CP862 */
#endif /* HEBREW */
#ifdef CYRILLIC
"cp866-cyrillic", FC_CP866, 0, /* CP866 Cyrillic */
#endif /* CYRILLIC */
#ifdef GREEK
"cp869-greek", FC_CP869, 0, /* CP869 Greek */
#endif /* GREEK */
#ifdef CYRILLIC
"cyrillic-iso", FC_CYRILL, 0, /* ISO Latin/Cyrillic Alphabet */
#endif /* CYRILLIC */
"danish", FC_NOASCII, 0, /* Norwegian and Danish NRC */
"dec-mcs", FC_DECMCS, CM_INV, /* DEC multinational char set */
"dec-multinational", FC_DECMCS, 0, /* DEC multinational character set */
"dg-international", FC_DGMCS, 0, /* Data General multinational */
"dutch", FC_DUASCII, 0, /* Dutch NRC */
#ifdef GREEK
"elot927-greek", FC_ELOT, 0, /* ELOT 927 Greek */
"elot928-greek", FC_GREEK, 0, /* Same as ISO 8859-7 Latin/Greek */
#endif /* GREEK */
"finnish", FC_FIASCII, 0, /* Finnish NRC */
"french", FC_FRASCII, 0, /* French NRC */
"fr-canadian", FC_FCASCII, CM_INV, /* French Canadian NRC */
"german", FC_GEASCII, 0, /* German NRC */
#ifdef GREEK
"greek-iso", FC_GREEK, 0, /* ISO 8859-7 Latin/Greek */
#endif /* GREEK */
#ifdef HEBREW
"he", FC_HEBREW, CM_ABR|CM_INV,
"heb", FC_HEBREW, CM_ABR|CM_INV,
"hebr", FC_HEBREW, CM_ABR|CM_INV,
"hebre", FC_HEBREW, CM_ABR|CM_INV,
"hebrew", FC_HEBREW, CM_ABR|CM_INV,
"hebrew-7", FC_HE7, 0, /* DEC 7-Bit Hebrew */
"hebrew-iso", FC_HEBREW, 0, /* ISO Latin/Hebrew */
#endif /* HEBREW */
"hp-roman8", FC_HPR8, 0, /* Hewlett Packard Roman8 */
"hungarian", FC_HUASCII, 0, /* Hungarian NRC */
"ibm437", FC_CP437, CM_INV, /* PC CP437 */
"ibm850", FC_CP850, CM_INV, /* PC CP850 (not in MIME) */
#ifdef LATIN2
"ibm852", FC_CP852, CM_INV, /* PC CP852 */
#endif /* LATIN2 */
#ifdef CYRILLIC
"ibm855", FC_CP855, CM_INV, /* PC CP855 */
#endif /* CYRILLIC */
"ibm858", FC_CP858, CM_INV, /* PC CP858 (not in MIME) */
#ifdef HEBREW
"ibm862", FC_CP862, CM_INV, /* PC CP862 (not in MIME) */
#endif /* HEBREW */
#ifdef CYRILLIC
"ibm866", FC_CP866, CM_INV, /* CP866 Cyrillic */
#endif /* CYRILLIC */
#ifdef GREEK
"ibm869", FC_CP869, CM_INV, /* CP869 Greek */
#endif /* GREEK */
#ifdef UNICODE
"iso-10646-ucs-2", FC_UCS2, CM_INV, /* ISO 10646 / Unicode UCS-2 */
#endif /* UNICODE */
"iso-8859-1", FC_1LATIN, CM_INV, /* ISO Latin Alphabet 1 */
"iso-8859-15", FC_9LATIN, CM_INV, /* ISO Latin Alphabet 9 (yes) */
"iso-8859-2", FC_2LATIN, CM_INV, /* ISO Latin Alphabet 2 */
#ifdef CYRILLIC
"iso-8859-5", FC_CYRILL, CM_INV, /* ISO Latin/Cyrillic Alphabet */
#endif /* CYRILLIC */
#ifdef GREEK
"iso-8859-7", FC_GREEK, CM_INV, /* ISO 8859-7 Latin/Greek */
#endif /* GREEK */
#ifdef HEBREW
"iso-8859-8", FC_HEBREW, CM_INV, /* ISO Latin/Hebrew */
#endif /* HEBREW */
"iso646-gb", FC_UKASCII, CM_INV, /* British NRC */
"iso646-ca", FC_FCASCII, CM_INV, /* French Canadian NRC */
"iso646-de", FC_GEASCII, CM_INV, /* German NRC */
"iso646-dk", FC_NOASCII, CM_INV, /* Norwegian and Danish NRC */
"iso646-es", FC_SPASCII, CM_INV, /* Spanish NRC */
"iso646-fi", FC_FIASCII, CM_INV, /* Finnish NRC */
"iso646-fr", FC_FRASCII, CM_INV, /* French NRC */
"iso646-hu", FC_HUASCII, CM_INV, /* Hungarian NRC */
"iso646-it", FC_ITASCII, CM_INV, /* Italian NRC */
"iso646-no", FC_NOASCII, CM_INV, /* Norwegian and Danish NRC */
"iso646-po", FC_POASCII, CM_INV, /* Portuguese NRC */
"iso646-se", FC_SWASCII, CM_INV, /* Swedish NRC */
"italian", FC_ITASCII, CM_INV, /* Italian NRC */
#ifdef CYRILLIC
"k", FC_KOI8, CM_ABR|CM_INV,
"ko", FC_KOI8, CM_ABR|CM_INV,
"koi", FC_KOI8, CM_ABR|CM_INV,
"koi7", FC_KOI7, 0, /* Short KOI Cyrillic */
"koi8", FC_KOI8, 0, /* Old KOI-8 Cyrillic */
"koi8-e", FC_KOI8, CM_INV, /* Old KOI-8 Cyrillic */
"koi8-cyrillic", FC_KOI8, CM_INV,
"koi8-r", FC_KOI8R, CM_INV, /* KOI8-R RFC1489 */
"koi8-u", FC_KOI8U, CM_INV, /* KOI8-U RFC2319 */
"koi8r", FC_KOI8R, 0, /* KOI8-R RFC1489 */
"koi8u", FC_KOI8U, 0, /* KOI8-U RFC2319 */
#endif /* CYRILLIC */
"l", FC_1LATIN, CM_ABR|CM_INV,
"la", FC_1LATIN, CM_ABR|CM_INV,
"lat", FC_1LATIN, CM_ABR|CM_INV,
"lati", FC_1LATIN, CM_ABR|CM_INV,
"latin", FC_1LATIN, CM_ABR|CM_INV,
"latin1-iso", FC_1LATIN, 0, /* ISO Latin Alphabet 1 */
#ifdef LATIN2
"latin2-iso", FC_2LATIN, 0, /* ISO Latin Alphabet 2 */
#endif /* LATIN2 */
"latin9-iso", FC_9LATIN, 0, /* ISO Latin Alphabet 9 */
"macintosh-latin", FC_APPQD, 0, /* "Extended Mac Latin" */
#ifdef LATIN2
"mazovia-pc", FC_MAZOVIA, 0, /* Polish Mazovia PC code page */
#endif /* LATIN2 */
"next-multinational", FC_NEXT, 0, /* NeXT workstation */
"norwegian", FC_NOASCII, 0, /* Norwegian and Danish NRC */
"portuguese", FC_POASCII, 0, /* Portuguese NRC */
#ifdef CYRILLIC
"short-koi", FC_KOI7, 0, /* Short KOI Cyrillic */
#endif /* CYRILLIC */
"spanish", FC_SPASCII, 0, /* Spanish NRC */
"swedish", FC_SWASCII, 0, /* Swedish NRC */
"swiss", FC_CHASCII, 0, /* Swiss NRC */
"transparent", FC_TRANSP, 0, /* Transparent */
#ifdef UNICODE
"ucs2", FC_UCS2, 0, /* ISO 10646 / Unicode UCS-2 */
#endif /* UNICODE */
"us-ascii", FC_USASCII, CM_INV, /* MIME */
"usascii", FC_USASCII, CM_INV,
#ifdef UNICODE
"utf-8", FC_UTF8, CM_INV, /* ISO 10646 / Unicode UTF-8 */
"utf8", FC_UTF8, 0, /* ISO 10646 / Unicode UTF-8 */
#endif /* UNICODE */
#ifdef LATIN2
"windows-1250", FC_CP1250, CM_INV, /* Windows CP 1250 */
#endif /* LATIN2 */
#ifdef CYRILLIC
"windows-1251", FC_CP1251, CM_INV, /* Windows CP 1251 */
#endif /* CYRILLIC */
"windows-1252", FC_CP1252, CM_INV, /* Windows CP 1252 */
"", 0, 0
};
int ntermc = (sizeof(ttcstab) / sizeof(struct keytab)) - 1;
/* This table contains the equivalent FCS number for each TCS. */
/* If the TC_xxx symbol definitions are ever changed, fix this table. */
/* Ditto if another TCS is added. */
int
cseqtab[MAXTCSETS+1] = { /* TCS/FCS equivalency table */
-1, /* 0 = Transparent */
FC_USASCII, /* 1 = ASCII */
FC_1LATIN, /* 2 = Latin-1 */
FC_2LATIN, /* 3 = Latin-2 */
FC_CYRILL, /* 4 = Latin/Cyrillic */
FC_JEUC, /* 5 = Japanese EUC */
FC_HEBREW, /* 6 = Latin/Hebrew */
FC_GREEK, /* 7 = Latin/Greek */
FC_9LATIN, /* 8 = Latin-9 */
FC_UCS2, /* 9 = UCS-2 */
FC_UTF8 /* 10 = UTF-8 */
};
/*
Languages:
This table allows C-Kermit to have a SET LANGUAGE command to apply special
language-specific rules when translating from a character set that contains
national characters into plain ASCII, like German umlaut-a becomes ae.
Originally, I thought it would be a good idea to let SET LANGUAGE also select
an appropriate FILE CHARACTER-SET and TRANSFER CHARACTER-SET automatically,
and these are included in the langinfo structure. Later I realized that this
was a bad idea. Any particular language (e.g. Dutch) can be represented by
many different and incompatible character sets.
(But we could use the new (1998) ASSOCIATE command for this...)
*/
struct langinfo langs[] = {
/* Language code File Charset Xfer Charset Name */
L_USASCII, FC_USASCII, TC_USASCII, "ASCII (American English)",
L_DANISH, FC_NOASCII, TC_1LATIN, "Danish",
L_DUTCH, FC_DUASCII, TC_1LATIN, "Dutch",
L_FINNISH, FC_FIASCII, TC_1LATIN, "Finnish",
L_FRENCH, FC_FRASCII, TC_1LATIN, "French",
L_GERMAN, FC_GEASCII, TC_1LATIN, "German",
#ifdef GREEK
L_GREEK, FC_GREEK, TC_GREEK, "Greek",
#endif /* GREEK */
#ifdef HEBREW
L_HEBREW, FC_HEBREW, TC_HEBREW, "Hebrew",
#endif /* HEBREW */
L_HUNGARIAN, FC_HUASCII, TC_2LATIN, "Hungarian",
L_ICELANDIC, FC_USASCII, TC_1LATIN, "Icelandic",
L_ITALIAN, FC_ITASCII, TC_1LATIN, "Italian",
#ifdef KANJI
L_JAPANESE, FC_JEUC, TC_JEUC, "Japanese",
#endif /* KANJI */
L_NORWEGIAN, FC_NOASCII, TC_1LATIN, "Norwegian",
L_PORTUGUESE, FC_POASCII, TC_1LATIN, "Portuguese",
#ifdef CYRILLIC
L_RUSSIAN, FC_CP866, TC_CYRILL, "Russian",
#endif /* CYRILLIC */
L_SPANISH, FC_SPASCII, TC_1LATIN, "Spanish",
L_SWEDISH, FC_SWASCII, TC_1LATIN, "Swedish",
L_SWISS, FC_CHASCII, TC_1LATIN, "Swiss"
};
int nlangs = (sizeof(langs) / sizeof(struct langinfo));
/*
Keyword table for the SET LANGUAGE command.
Only a few of these (German, Scandinavian, etc) actually do anything.
The language is used to invoke special translation rules when converting
from an 8-bit character set to ASCII; for example, German u-diaeresis
becomes "ue", Dutch y-diaeresis becomes "ij". Languages without associated
rules are invisible (CM_INV).
*/
struct keytab lngtab[] = {
"ascii", L_USASCII, CM_INV,
"danish", L_DANISH, 0,
"dutch", L_DUTCH, 0,
"english", L_USASCII, CM_INV,
"finnish", L_FINNISH, 0,
"french", L_FRENCH, 0,
"german", L_GERMAN, 0,
#ifdef GREEK
"greek", L_GREEK, CM_INV,
#endif /* GREEK */
#ifdef HEBREW
"hebrew", L_HEBREW, CM_INV,
#endif /* HEBREW */
"hungarian", L_HUNGARIAN, CM_INV,
"icelandic", L_ICELANDIC, 0,
"italian", L_ITALIAN, CM_INV,
#ifdef KANJI
"japanese", L_JAPANESE, CM_INV,
#endif /* KANJI */
"norwegian", L_NORWEGIAN, 0,
"none", L_USASCII, 0,
"portuguese", L_PORTUGUESE, CM_INV,
#ifdef CYRILLIC
"russian", L_RUSSIAN, 0,
#endif /* CYRILLIC */
"spanish", L_SPANISH, CM_INV,
"swedish", L_SWEDISH, 0,
#ifdef CYRILLIC
"ukrainian", L_RUSSIAN, 0,
#endif /* CYRILLIC */
"", 0, 0
};
int nlng = (sizeof(lngtab) / sizeof(struct keytab)) - 1; /* how many */
/* Translation tables ... */
/*
For each pair of (transfer,file) character sets, we need two translation
functions, one for sending, one for receiving.
*/
/*
Here is the first table, Latin-1 to ASCII, fully annotated...
This one is absolutely NOT invertible, since we're going from an 8-bit
set to a 7-bit set. Accented letters are mapped to unaccented
equivalents, C1 control characters are all translated to "?", etc.
*/
CONST CHAR
yl1as[] = { /* ISO 8859-1 Latin Alphabet 1 to US ASCII */
/* Source character Description => Translation */
/* Dec row/col Set */
0, /* 000 00/00 C0 NUL Ctrl-@ => (self) */
1, /* 001 00/01 C0 SOH Ctrl-A => (self) */
2, /* 002 00/02 C0 STX Ctrl-B => (self) */
3, /* 003 00/03 C0 ETX Ctrl-C => (self) */
4, /* 004 00/04 C0 EOT Ctrl-D => (self) */
5, /* 005 00/05 C0 ENQ Ctrl-E => (self) */
6, /* 006 00/06 C0 ACK Ctrl-F => (self) */
7, /* 007 00/07 C0 BEL Ctrl-G => (self) */
8, /* 008 00/08 C0 BS Ctrl-H => (self) */
9, /* 009 00/09 C0 HT Ctrl-I => (self) */
10, /* 010 00/10 C0 LF Ctrl-J => (self) */
11, /* 011 00/11 C0 VT Ctrl-K => (self) */
12, /* 012 00/12 C0 FF Ctrl-L => (self) */
13, /* 013 00/13 C0 CR Ctrl-M => (self) */
14, /* 014 00/14 C0 SO Ctrl-N => (self) */
15, /* 015 00/15 C0 SI Ctrl-O => (self) */
16, /* 016 01/00 C0 DLE Ctrl-P => (self) */
17, /* 017 01/01 C0 DC1 Ctrl-Q => (self) */
18, /* 018 01/02 C0 DC2 Ctrl-R => (self) */
19, /* 019 01/03 C0 DC3 Ctrl-S => (self) */
20, /* 020 01/04 C0 DC4 Ctrl-T => (self) */
21, /* 021 01/05 C0 NAK Ctrl-U => (self) */
22, /* 022 01/06 C0 SYN Ctrl-V => (self) */
23, /* 023 01/07 C0 ETB Ctrl-W => (self) */
24, /* 024 01/08 C0 CAN Ctrl-X => (self) */
25, /* 025 01/09 C0 EM Ctrl-Y => (self) */
26, /* 026 01/10 C0 SUB Ctrl-Z => (self) */
27, /* 027 01/11 C0 ESC Ctrl-[ => (self) */
28, /* 028 01/12 C0 FS Ctrl-\ => (self) */
29, /* 029 01/13 C0 GS Ctrl-] => (self) */
30, /* 030 01/14 C0 RS Ctrl-^ => (self) */
31, /* 031 01/15 C0 US Ctrl-_ => (self) */
32, /* 032 02/00 SP Space => (self) */
33, /* 033 02/01 G0 ! Exclamation mark => (self) */
34, /* 034 02/02 G0 " Doublequote => (self) */
35, /* 035 02/03 G0 # Number sign => (self) */
36, /* 036 02/04 G0 $ Dollar sign => (self) */
37, /* 037 02/05 G0 % Percent sign => (self) */
38, /* 038 02/06 G0 & Ampersand => (self) */
39, /* 039 02/07 G0 ' Apostrophe => (self) */
40, /* 040 02/08 G0 ( Left parenthesis => (self) */
41, /* 041 02/09 G0 ) Right parenthesis => (self) */
42, /* 042 02/10 G0 * Asterisk => (self) */
43, /* 043 02/11 G0 + Plus sign => (self) */
44, /* 044 02/12 G0 , Comma => (self) */
45, /* 045 02/13 G0 - Hyphen, minus sign => (self) */
46, /* 046 02/14 G0 . Period, full stop => (self) */
47, /* 047 02/15 G0 / Slash, solidus => (self) */
48, /* 048 03/00 G0 0 Digit 0 => (self) */
49, /* 049 03/01 G0 1 Digit 1 => (self) */
50, /* 050 03/02 G0 2 Digit 2 => (self) */
51, /* 051 03/03 G0 3 Digit 3 => (self) */
52, /* 052 03/04 G0 4 Digit 4 => (self) */
53, /* 053 03/05 G0 5 Digit 5 => (self) */
54, /* 054 03/06 G0 6 Digit 6 => (self) */
55, /* 055 03/07 G0 7 Digit 7 => (self) */
56, /* 056 03/08 G0 8 Digit 8 => (self) */
57, /* 057 03/09 G0 9 Digit 9 => (self) */
58, /* 058 03/10 G0 : Colon => (self) */
59, /* 059 03/11 G0 ; Semicolon => (self) */
60, /* 060 03/12 G0 < Less-than sign => (self) */
61, /* 061 03/13 G0 = Equals sign => (self) */
62, /* 062 03/14 G0 > Greater-than sign => (self) */
63, /* 063 03/15 G0 ? Question mark => (self) */
64, /* 064 04/00 G0 @ Commercial at sign => (self) */
65, /* 065 04/01 G0 A Letter A => (self) */
66, /* 066 04/02 G0 B Letter B => (self) */
67, /* 067 04/03 G0 C Letter C => (self) */
68, /* 068 04/04 G0 D Letter D => (self) */
69, /* 069 04/05 G0 E Letter E => (self) */
70, /* 070 04/06 G0 F Letter F => (self) */
71, /* 071 04/07 G0 G Letter G => (self) */
72, /* 072 04/08 G0 H Letter H => (self) */
73, /* 073 04/09 G0 I Letter I => (self) */
74, /* 074 04/10 G0 J Letter J => (self) */
75, /* 075 04/11 G0 K Letter K => (self) */
76, /* 076 04/12 G0 L Letter L => (self) */
77, /* 077 04/13 G0 M Letter M => (self) */
78, /* 078 04/14 G0 N Letter N => (self) */
79, /* 079 04/15 G0 O Letter O => (self) */
80, /* 080 05/00 G0 P Letter P => (self) */
81, /* 081 05/01 G0 Q Letter Q => (self) */
82, /* 082 05/02 G0 R Letter R => (self) */
83, /* 083 05/03 G0 S Letter S => (self) */
84, /* 084 05/04 G0 T Letter T => (self) */
85, /* 085 05/05 G0 U Letter U => (self) */
86, /* 086 05/06 G0 V Letter V => (self) */
87, /* 087 05/07 G0 W Letter W => (self) */
88, /* 088 05/08 G0 X Letter X => (self) */
89, /* 089 05/09 G0 Y Letter Y => (self) */
90, /* 090 05/10 G0 Z Letter Z => (self) */
91, /* 091 05/11 G0 [ Left square bracket => (self) */
92, /* 092 05/12 G0 \ Reverse slash => (self) */
93, /* 093 05/13 G0 ] Right square bracket => (self) */
94, /* 094 05/14 G0 ^ Circumflex accent => (self) */
95, /* 095 05/15 G0 _ Underline, low line => (self) */
96, /* 096 06/00 G0 ` Grave accent => (self) */
97, /* 097 06/01 G0 a Letter a => (self) */
98, /* 098 06/02 G0 b Letter b => (self) */
99, /* 099 06/03 G0 c Letter c => (self) */
100, /* 100 06/04 G0 d Letter d => (self) */
101, /* 101 06/05 G0 e Letter e => (self) */
102, /* 102 06/06 G0 f Letter f => (self) */
103, /* 103 06/07 G0 g Letter g => (self) */
104, /* 104 06/08 G0 h Letter h => (self) */
105, /* 105 06/09 G0 i Letter i => (self) */
106, /* 106 06/10 G0 j Letter j => (self) */
107, /* 107 06/11 G0 k Letter k => (self) */
108, /* 108 06/12 G0 l Letter l => (self) */
109, /* 109 06/13 G0 m Letter m => (self) */
110, /* 110 06/14 G0 n Letter n => (self) */
111, /* 111 06/15 G0 o Letter o => (self) */
112, /* 112 07/00 G0 p Letter p => (self) */
113, /* 113 07/01 G0 q Letter q => (self) */
114, /* 114 07/02 G0 r Letter r => (self) */
115, /* 115 07/03 G0 s Letter s => (self) */
116, /* 116 07/04 G0 t Letter t => (self) */
117, /* 117 07/05 G0 u Letter u => (self) */
118, /* 118 07/06 G0 v Letter v => (self) */
119, /* 119 07/07 G0 w Letter w => (self) */
120, /* 120 07/08 G0 x Letter x => (self) */
121, /* 121 07/09 G0 y Letter y => (self) */
122, /* 122 07/10 G0 z Letter z => (self) */
123, /* 123 07/11 G0 { Left curly bracket => (self) */
124, /* 124 07/12 G0 | Vertical bar => (self) */
125, /* 125 07/13 G0 } Right curly bracket => (self) */
126, /* 126 07/14 G0 ~ Tilde => (self) */
127, /* 127 07/15 DEL Delete, Rubout => (self) */
UNK, /* 128 08/00 C1 => UNK */
UNK, /* 129 08/01 C1 => UNK */
UNK, /* 130 08/02 C1 => UNK */
UNK, /* 131 08/03 C1 => UNK */
UNK, /* 132 08/04 C1 IND => UNK */
UNK, /* 133 08/05 C1 NEL => UNK */
UNK, /* 134 08/06 C1 SSA => UNK */
UNK, /* 135 08/07 C1 ESA => UNK */
UNK, /* 136 08/08 C1 HTS => UNK */
UNK, /* 137 08/09 C1 => UNK */
UNK, /* 138 08/10 C1 => UNK */
UNK, /* 139 08/11 C1 => UNK */
UNK, /* 140 08/12 C1 => UNK */
UNK, /* 141 08/13 C1 RI => UNK */
UNK, /* 142 08/14 C1 SS2 => UNK */
UNK, /* 143 08/15 C1 SS3 => UNK */
UNK, /* 144 09/00 C1 DCS => UNK */
UNK, /* 145 09/01 C1 => UNK */
UNK, /* 146 09/02 C1 => UNK */
UNK, /* 147 09/03 C1 STS => UNK */
UNK, /* 148 09/04 C1 => UNK */
UNK, /* 149 09/05 C1 => UNK */
UNK, /* 150 09/06 C1 SPA => UNK */
UNK, /* 151 09/07 C1 EPA => UNK */
UNK, /* 152 09/08 C1 => UNK */
UNK, /* 153 09/09 C1 => UNK */
UNK, /* 154 09/10 C1 => UNK */
UNK, /* 155 09/11 C1 CSI => UNK */
UNK, /* 156 09/12 C1 ST => UNK */
UNK, /* 157 09/13 C1 OSC => UNK */
UNK, /* 158 09/14 C1 PM => UNK */
UNK, /* 159 09/15 C1 APC => UNK */
32, /* 160 10/00 G1 No-break space => SP */
33, /* 161 10/01 G1 Inverted exclamation => ! */
99, /* 162 10/02 G1 Cent sign => c */
35, /* 163 10/03 G1 Pound sign => # */
36, /* 164 10/04 G1 Currency sign => $ */
89, /* 165 10/05 G1 Yen sign => Y */
124, /* 166 10/06 G1 Broken bar => | */
80, /* 167 10/07 G1 Paragraph sign => P */
34, /* 168 10/08 G1 Diaeresis => " */
67, /* 169 10/09 G1 Copyright sign => C */
97, /* 170 10/10 G1 Feminine ordinal => a */
34, /* 171 10/11 G1 Left angle quotation => " */
126, /* 172 10/12 G1 Not sign => ~ */
45, /* 173 10/13 G1 Soft hyphen => - */
82, /* 174 10/14 G1 Registered trade mark => R */
95, /* 175 10/15 G1 Macron => _ */
111, /* 176 11/00 G1 Degree sign, ring above => o */
UNK, /* 177 11/01 G1 Plus-minus sign => UNK */
50, /* 178 11/02 G1 Superscript two => 2 */
51, /* 179 11/03 G1 Superscript three => 3 */
39, /* 180 11/04 G1 Acute accent => ' */
117, /* 181 11/05 G1 Micro sign => u */
45, /* 182 11/06 G1 Pilcrow sign => - */
45, /* 183 11/07 G1 Middle dot => - */
44, /* 184 11/08 G1 Cedilla => , */
49, /* 185 11/09 G1 Superscript one => 1 */
111, /* 186 11/10 G1 Masculine ordinal => o */
34, /* 187 11/11 G1 Right angle quotation => " */