home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / cku200.zip / ckuxla.c < prev    next >
C/C++ Source or Header  |  2001-06-27  |  277KB  |  7,445 lines

  1. #include "ckcsym.h"
  2.  
  3. #include "ckcdeb.h"            /* Includes... */
  4. #include "ckcker.h"
  5. #include "ckucmd.h"
  6. #include "ckcxla.h"
  7.  
  8. #ifdef NOXFER
  9. #define zdstuff(a)
  10. #endif /* NOXFER */
  11.  
  12. #ifndef NOCSETS
  13. char *xlav = "Character Set Translation 8.0.042, 3 Jul 2000";
  14.  
  15. /*  C K U X L A  */
  16.  
  17. /*  C-Kermit tables and functions supporting character set translation.  */
  18. /*
  19.   Author: Frank da Cruz <fdc@columbia.edu>,
  20.   Columbia University Academic Information Systems, New York City.
  21.  
  22.   Copyright (C) 1985, 2001,
  23.     Trustees of Columbia University in the City of New York.
  24.     All rights reserved.  See the C-Kermit COPYING.TXT file or the
  25.     copyright text in the ckcmai.c module for disclaimer and permissions.
  26. */
  27.  
  28. /* Character set translation data and functions */
  29.  
  30. extern int zincnt;            /* File i/o macros and variables */
  31. extern char *zinptr;
  32. extern int zoutcnt;
  33. extern char *zoutptr;
  34. extern int byteorder;
  35. extern int xfrxla;
  36.  
  37. int tslevel  = TS_L0;            /* Transfer syntax level (0,1,2) */
  38. int tcharset = TC_TRANSP;        /* Transfer syntax character set */
  39. int tcs_save = -1;            /* For save/restore term charset */
  40. int tcs_transp = 0;            /* Term charset is TRANSPARENT flag */
  41.  
  42. #ifdef CKOUNI
  43. int tcsr     = TX_8859_1;        /* Remote terminal character set */
  44. #else /* CKOUNI */
  45. int tcsr     = FC_USASCII;
  46. #endif /* CKOUNI */
  47. int language = L_USASCII;        /* Language */
  48.  
  49. #ifdef UNICODE
  50. int ucsbom = 1;                /* Add BOM to new UCS files? */
  51. int ucsorder = -1;            /* Default byte order for UCS files */
  52. int fileorder = -1;            /* Byte order of current file */
  53.                     /* 0 = BE, 1 = LE */
  54. #endif /* UNICODE */
  55. /*
  56.   Default local file and terminal character set.
  57.   Normally ASCII, but for some systems we know otherwise.
  58. */
  59. int fcs_save = -1;
  60. #ifdef datageneral            /* Data General AOS/VS */
  61. int fcharset = FC_DGMCS;        /* uses the DG International set */
  62. int dcset8   = FC_DGMCS;
  63. int dcset7   = FC_USASCII;
  64. int tcsl     = FC_DGMCS;
  65. #else
  66. #ifdef NEXT                /* The NeXT workstation */
  67. int fcharset = FC_NEXT;            /* uses its own 8-bit set */
  68. int dcset8   = FC_NEXT;
  69. int dcset7   = FC_USASCII;
  70. int tcsl     = FC_NEXT;
  71. #else
  72. #ifdef MAC                /* The Macintosh */
  73. int fcharset = FC_APPQD;        /* uses an extended version of */
  74. int dcset8   = FC_APPQD;
  75. int dcset7   = FC_USASCII;
  76. int tcsl     = FC_APPQD;        /* Apple Quickdraw */
  77. #else
  78. #ifdef AUX
  79. int fcharset = FC_APPQD;        /* Ditto for Apple A/UX */
  80. int dcset8   = FC_APPQD;
  81. int dcset7   = FC_USASCII;
  82. int tcsl     = FC_APPQD;
  83. #else
  84. #ifdef AMIGA                /* The Commodore Amiga */
  85. int fcharset = FC_1LATIN;        /* uses Latin-1 */
  86. int dcset8   = FC_1LATIN;
  87. int dcset7   = FC_USASCII;
  88. int tcsl     = FC_1LATIN;
  89. #else                    /* All others */
  90. #ifdef CKOUNI                 /* OS/2 Unicode */
  91. int fcharset = FC_1LATIN;
  92. int dcset8   = FC_1LATIN;
  93. int dcset7   = FC_USASCII;
  94. int tcsl     = TX_8859_1;
  95. #else                    /* All others */
  96. int fcharset = FC_USASCII;        /* use ASCII by default */
  97. int dcset8   = FC_1LATIN;        /* But default 8-bit set is Latin-1 */
  98. int dcset7   = FC_USASCII;
  99. int tcsl     = FC_USASCII;
  100. #endif /* CKOUNI */
  101. #endif /* AMIGA */
  102. #endif /* AUX */
  103. #endif /* MAC */
  104. #endif /* NEXT */
  105. #endif /* datageneral */
  106.  
  107. int s_cset = XMODE_A;            /* SEND charset selection = AUTO */
  108. int r_cset = XMODE_A;            /* RECV charset selection = AUTO */
  109. int afcset[MAXFCSETS+1];        /* Character-set associations */
  110. int axcset[MAXTCSETS+1];
  111. int xlatype = XLA_NONE;            /* Translation type */
  112.  
  113. #ifdef UNICODE
  114. #ifdef CK_ANSIC
  115. extern int (*xl_utc[MAXTCSETS+1])(USHORT);  /* Unicode to TCS */
  116. extern int (*xl_ufc[MAXFCSETS+1])(USHORT);  /* Unicode to FCS */
  117. extern USHORT (*xl_tcu[MAXTCSETS+1])(CHAR); /* TCS to Unicode */
  118. extern USHORT (*xl_fcu[MAXFCSETS+1])(CHAR); /* FCS to Unicode */
  119. #else
  120. extern int (*xl_utc[MAXTCSETS+1])();
  121. extern int (*xl_ufc[MAXFCSETS+1])();
  122. extern USHORT (*xl_tcu[MAXTCSETS+1])();
  123. extern USHORT (*xl_fcu[MAXFCSETS+1])();
  124. #endif /* CK_ANSIC */
  125. #endif /* UNICODE */
  126.  
  127. /* Bureaucracy section */
  128.  
  129. _PROTOTYP( CHAR xnel1, (CHAR c) );    /* NeXT to Latin-1 */
  130. _PROTOTYP( CHAR xl143, (CHAR c) );    /* Latin-1 to IBM CP437 */
  131. _PROTOTYP( CHAR xl1as, (CHAR c) );    /* Latin-1 to US ASCII */
  132. _PROTOTYP( CHAR zl1as, (CHAR c) );    /* Latin-1 to US ASCII */
  133.  
  134. #ifdef CYRILLIC
  135. _PROTOTYP( CHAR xassk, (CHAR c) );    /* ASCII to Short KOI */
  136. _PROTOTYP( CHAR xskcy, (CHAR c) );    /* Short KOI to Latin/Cyrillic */
  137. #endif /* CYRILLIC */
  138.  
  139. #ifdef LATIN2
  140. _PROTOTYP( CHAR xnel2, (CHAR c) );    /* NeXT to Latin-2 */
  141. _PROTOTYP( CHAR xl243, (CHAR c) );    /* Latin-2 to IBM CP437 */
  142. _PROTOTYP( CHAR xl2as, (CHAR c) );    /* Latin-2 to US ASCII */
  143. _PROTOTYP( CHAR zl2as, (CHAR c) );    /* Latin-2 to US ASCII */
  144. _PROTOTYP( CHAR xl2r8, (CHAR c) );    /* Latin-2 to HP */
  145. _PROTOTYP( CHAR xl2l9, (CHAR c) );    /* Latin-2 to Latin-9 */
  146. _PROTOTYP( CHAR xl9l2, (CHAR c) );    /* Latin-9 to Latin-2 */
  147. _PROTOTYP( CHAR xl2mz, (CHAR c) );    /* Latin-2 to Mazovia */
  148. _PROTOTYP( CHAR xmzl2, (CHAR c) );    /* Mazovia to Latin-2 */
  149. _PROTOTYP( CHAR xl1mz, (CHAR c) );    /* Latin-1 to Mazovia */
  150. _PROTOTYP( CHAR xmzl1, (CHAR c) );    /* Mazovia to Latin-1 */
  151. _PROTOTYP( CHAR xmzl9, (CHAR c) );    /* Latin-9 to Mazovia */
  152. _PROTOTYP( CHAR xl9mz, (CHAR c) );    /* Mazovia to Latin-9 */
  153. #endif /* LATIN2 */
  154.  
  155. /* Transfer character-set info */
  156.  
  157. struct csinfo tcsinfo[] = {
  158. /*  Name              size code      designator alphabet keyword            */
  159.   "TRANSPARENT",       256,TC_TRANSP, "",      AL_UNK,  "transparent",  /* 0 */
  160.   "ASCII",             128,TC_USASCII,"",      AL_ROMAN,"ascii",        /* 1 */
  161.   "ISO 8859-1 Latin-1",256,TC_1LATIN, "I6/100",AL_ROMAN,"latin1-iso",   /* 2 */
  162. #ifdef LATIN2
  163.   "ISO 8859-2 Latin-2",256,TC_2LATIN, "I6/101",AL_ROMAN,"latin2-iso",   /* 3 */
  164. #endif /* LATIN2 */
  165. #ifdef CYRILLIC
  166.   /* 4 */
  167.   "ISO 8859-5 Latin/Cyrillic",256,TC_CYRILL,"I6/144",AL_CYRIL,"cyrillic-iso",
  168. #endif /* CYRILLIC */
  169. #ifdef KANJI
  170.   "Japanese EUC",16384,TC_JEUC,  "I14/87/13", AL_JAPAN, "euc-jp",       /* 5 */
  171. #endif /* KANJI */
  172. #ifdef HEBREW
  173.   /* 6 */
  174.   "ISO 8859-8 Latin/Hebrew",256,TC_HEBREW,"I6/138",AL_HEBREW,"hebrew-iso",
  175. #endif /* HEBREW */
  176. #ifdef GREEK
  177.   "ISO 8859-7 Latin/Greek",256,TC_GREEK,"I6/126",AL_GREEK,"greek-iso", /*  7 */
  178. #endif /* GREEK */
  179.   "ISO 8859-15 Latin-9",256,TC_9LATIN,"I6/203",AL_ROMAN,"latin9-iso",  /*  8 */
  180.   "ISO 10646 / Unicode UCS-2",64000,TC_UCS2,"I162",AL_UNIV,"ucs2",     /*  9 */
  181.   "ISO 10646 / Unicode UTF-8",64000,TC_UTF8,"I190",AL_UNIV,"utf8",     /* 10 */
  182.   "",0,0,"",0,""
  183. };
  184. int ntcsets = (sizeof(tcsinfo) / sizeof(struct csinfo)) - 1;
  185.  
  186. struct keytab tcstab[] = {        /* Keyword table for */
  187.     "ascii",         TC_USASCII, 0,    /* SET TRANSFER CHARACTER-SET */
  188. #ifdef CYRILLIC
  189.     "cyrillic-iso",  TC_CYRILL,  0,
  190. #endif /* CYRILLIC */
  191. #ifdef GREEK
  192.     "elot928-greek", TC_GREEK,   CM_INV,
  193. #endif /* GREEK */
  194. #ifdef KANJI
  195.     "euc-jp",        TC_JEUC,    0,
  196. #endif /* KANJI */
  197. #ifdef GREEK
  198.     "greek-iso",     TC_GREEK,   0,
  199. #endif /* GREEK */
  200. #ifdef HEBREW
  201.     "hebrew-iso",    TC_HEBREW,  0,
  202. #endif /* HEBREW */
  203. #ifdef KANJI
  204.     "japanese-euc",  TC_JEUC,    CM_INV,
  205. #endif /* KANJI */
  206.     "l",             TC_1LATIN,  CM_ABR|CM_INV,
  207.     "la",            TC_1LATIN,  CM_ABR|CM_INV,
  208.     "lat",           TC_1LATIN,  CM_ABR|CM_INV,
  209.     "lati",          TC_1LATIN,  CM_ABR|CM_INV,
  210.     "latin",         TC_1LATIN,  CM_ABR|CM_INV,
  211.     "latin1-iso",    TC_1LATIN,  0,
  212. #ifdef LATIN2
  213.     "latin2-iso",    TC_2LATIN,  0,
  214. #endif /* LATIN2 */
  215.     "latin9-iso",    TC_9LATIN,  0,
  216.     "transparent",   TC_TRANSP,  0,
  217. #ifdef UNICODE
  218.     "ucs2",          TC_UCS2,    0,
  219.     "utf8",          TC_UTF8,    0,
  220. #endif /* UNICODE */
  221.     "", 0, 0
  222. };
  223. int ntcs = (sizeof(tcstab) / sizeof(struct keytab)) - 1;
  224.  
  225. /* File character set information structure, indexed by character set code, */
  226. /* as defined in ckuxla.h.  This table must be in order of file character */
  227. /* set number! */
  228.  
  229. struct csinfo fcsinfo[] = { /* File character set information... */
  230.   /* Descriptive Name              Size  Designator */
  231.   "US ASCII",                     128, FC_USASCII, NULL, AL_ROMAN, "ascii",
  232.   "British/UK ISO-646",           128, FC_UKASCII, NULL, AL_ROMAN, "british",
  233.   "Dutch ISO-646",                128, FC_DUASCII, NULL, AL_ROMAN, "dutch",
  234.   "Finnish ISO-646",              128, FC_FIASCII, NULL, AL_ROMAN, "finnish",
  235.   "French ISO-646",               128, FC_FRASCII, NULL, AL_ROMAN, "french",
  236.   "Canadian-French NRC", 128, FC_FCASCII, NULL, AL_ROMAN, "canadian-french",
  237.   "German ISO-646",               128, FC_GEASCII, NULL, AL_ROMAN, "german",
  238.   "Hungarian ISO-646",            128, FC_HUASCII, NULL, AL_ROMAN, "hungarian",
  239.   "Italian ISO-646",              128, FC_ITASCII, NULL, AL_ROMAN, "italian",
  240.   "Norwegian/Danish ISO-646",128,FC_NOASCII,NULL,AL_ROMAN,"norwegian/danish",
  241.   "Portuguese ISO-646",           128, FC_POASCII, NULL, AL_ROMAN,"portuguese",
  242.   "Spanish ISO-646",              128, FC_SPASCII, NULL, AL_ROMAN, "spanish",
  243.   "Swedish ISO-646",              128, FC_SWASCII, NULL, AL_ROMAN, "swedish",
  244.   "Swiss NRC",                    128, FC_CHASCII, NULL, AL_ROMAN, "swiss",
  245.   "ISO 8859-1 Latin-1",           256, FC_1LATIN,  NULL, AL_ROMAN,"latin1-iso",
  246.   "ISO 8859-2 Latin-2",           256, FC_2LATIN,  NULL, AL_ROMAN,"latin2-iso",
  247.   "DEC Multinational", 256,  FC_DECMCS, NULL,AL_ROMAN,"dec-multinational",
  248.   "NeXT Multinational", 256, FC_NEXT,   NULL,AL_ROMAN,"next-multinational",
  249.   "PC Code Page 437",            256, FC_CP437,   NULL, AL_ROMAN,"cp437",
  250.   "PC Code Page 850",            256, FC_CP850,   NULL, AL_ROMAN,"cp850",
  251.   "PC Code Page 852",            256, FC_CP852,   NULL, AL_ROMAN,"cp852",
  252.   "Apple Macintosh Latin", 256, FC_APPQD,   NULL, AL_ROMAN,"macintosh-latin",
  253.   "Data General International",256,FC_DGMCS,NULL,AL_ROMAN,"dg-international",
  254.   "Hewlett Packard Roman8",    256, FC_HPR8,    NULL, AL_ROMAN, "hp-roman8",
  255.   "ISO 8859-5 Latin/Cyrillic", 256, FC_CYRILL,  NULL, AL_CYRIL,"cyrillic-iso",
  256.   "CP866 Cyrillic",           256, FC_CP866,   NULL, AL_CYRIL,"cp866",
  257.   "Short KOI",                 128, FC_KOI7,    NULL, AL_CYRIL,"short-koi",
  258.   "Old KOI-8 Cyrillic",        256, FC_KOI8,    NULL, AL_CYRIL,"koi8-cyrillic",
  259.   "Japanese JIS7",      16384, FC_JIS7,    NULL, AL_JAPAN, "jis7-kanji",
  260.   "Japanese Shift JIS",      16384, FC_SHJIS,   NULL, AL_JAPAN, "shift-jis-kanji",
  261.   "Japanese EUC",      16384, FC_JEUC,    NULL, AL_JAPAN, "euc-jp",
  262.   "Japanese DEC Kanji",      16384, FC_JDEC,    NULL, AL_JAPAN, "dec-kanji",
  263.   "Hebrew-7 DEC",           128, FC_HE7,     NULL, AL_HEBREW, "hebrew-7",
  264.   "ISO 8859-8 Latin/Hebrew",256, FC_HEBREW,  NULL, AL_HEBREW, "hebrew-iso",
  265.   "CP862 Hebrew",           256, FC_CP862,   NULL, AL_HEBREW, "cp862-hebrew",
  266.   "ELOT 927 Greek",         128, FC_ELOT,    NULL, AL_GREEK, "elot927-greek",
  267.   "ISO 8859-7 Latin/Greek", 256, FC_GREEK,   NULL, AL_GREEK, "greek-iso",
  268.   "CP869 Greek",            256, FC_CP869,   NULL, AL_GREEK, "cp869-greek",
  269.   "ISO 8859-15 Latin-9",    256, FC_9LATIN,  NULL, AL_ROMAN, "latin9-iso",
  270.   "PC Code Page 858",       256, FC_CP850,   NULL, AL_ROMAN, "cp858",
  271.   "PC Code Page 855",       256, FC_CP855,   NULL, AL_CYRIL, "cp855-cyrillic",
  272.   "Windows Code Page 1251", 256, FC_CP1251,  NULL, AL_CYRIL, "cp1251-cyrillic",
  273.   "Bulgarian PC Code Page", 256, FC_BULGAR,  NULL, AL_CYRIL, "bulgaria-pc",
  274.   "Windows Code Page 1250", 256, FC_CP1250,  NULL, AL_ROMAN, "cp1250",
  275.   "Polish Mazovia PC Code Page", 256, FC_MAZOVIA, NULL, AL_ROMAN, "mazovia-pc",
  276.   "ISO 10646 / Unicode UCS-2", 64000, FC_UCS2, NULL, AL_UNIV, "ucs2",
  277.   "ISO 10646 / Unicode UTF-8", 64000, FC_UCS2, NULL, AL_UNIV, "utf8",
  278.   "KOI8-R Russian+Boxdrawing",256,  FC_KOI8R, NULL, AL_CYRIL,"koi8r",
  279.   "KOI8-U Ukrainian+Boxdrawing",256,FC_KOI8U, NULL, AL_CYRIL,"koi8u",
  280.   "Windows Code Page 1252", 256, FC_CP1252,  NULL, AL_ROMAN, "cp1252",
  281.   "",0,0,NULL,0,NULL
  282. };
  283.  
  284. /* Local file character sets */
  285. /* Includes 7-bit National Replacement Character Sets of ISO 646 */
  286. /* Plus ISO Latin-1, DEC Multinational Character Set (MCS), NeXT char set, */
  287. /* Various PC and Windows code pages, etc. */
  288.  
  289. struct keytab fcstab[] = { /* Keyword table for 'set file character-set' */
  290. /*
  291.   IMPORTANT: This table is replicated below as ttcstab (terminal character
  292.   set table).  The only differences are the addition of TRANSPARENT
  293.   and the removal of the Kanji sets, which are not supported yet.
  294.   If you make changes to this table, also change ttcstab.
  295. */
  296.  
  297. /* Keyword             Value       Flags */
  298.     "apple-quickdraw",    FC_APPQD,   CM_INV, /* Apple Quickdraw */
  299.     "ascii",              FC_USASCII, 0, /* ASCII */
  300.     "british",            FC_UKASCII, 0, /* British NRC */
  301.     "bulgaria-pc",        FC_BULGAR,  0, /* Bulgarian PC Code Page */
  302.     "canadian-french",    FC_FCASCII, 0, /* French Canadian NRC */
  303. #ifdef LATIN2
  304.     "cp1250",             FC_CP1250,  0, /* Windows CP 1250 */
  305. #endif /* LATIN2 */
  306. #ifdef CYRILLIC
  307.     "cp1251-cyrillic",    FC_CP1251,  0, /* Windows CP 1251 */
  308. #endif /* CYRILLIC */
  309.     "cp1252",             FC_CP1252,  0, /* Windows CP 1252 */
  310.     "cp437",              FC_CP437,   0, /* PC CP437 */
  311.     "cp850",              FC_CP850,   0, /* PC CP850 */
  312. #ifdef LATIN2
  313.     "cp852",              FC_CP852,   0, /* PC CP852 */
  314. #endif /* LATIN2 */
  315. #ifdef CYRILLIC
  316.     "cp855-cyrillic",     FC_CP855,   0, /* PC CP855 */
  317. #endif /* CYRILLIC */
  318.     "cp858",              FC_CP858,   0, /* PC CP858 */
  319. #ifdef HEBREW
  320.     "cp862-hebrew",       FC_CP862,   0, /* PC CP862 */
  321. #endif /* HEBREW */
  322. #ifdef CYRILLIC
  323.     "cp866-cyrillic",     FC_CP866,   0, /* CP866 Cyrillic */
  324. #endif /* CYRILLIC */
  325. #ifdef GREEK
  326.     "cp869-greek",        FC_CP869,   0, /* CP869 Greek */
  327. #endif /* GREEK */
  328. #ifdef CYRILLIC
  329.     "cyrillic-iso",       FC_CYRILL,  0, /* ISO Latin/Cyrillic Alphabet */
  330. #endif /* CYRILLIC */
  331.     "danish",             FC_NOASCII, 0, /* Norwegian and Danish NRC */
  332. #ifdef KANJI
  333.     "dec-kanji",          FC_JDEC,    0, /* Japanese DEC Kanji */
  334. #endif /* KANJI */
  335.     "dec-multinational",  FC_DECMCS,  0, /* DEC multinational character set */
  336.     "dg-international",   FC_DGMCS,   0, /* Data General multinational */
  337.     "dutch",              FC_DUASCII, 0, /* Dutch NRC */
  338. #ifdef GREEK
  339.     "elot927-greek",      FC_ELOT,    0, /* ELOT 927 Greek */
  340.     "elot928-greek",      FC_GREEK,   0, /* Same as ISO 8859-7 Latin/Greek */
  341. #endif /* GREEK */
  342. #ifdef KANJI
  343.     "euc-jp",             FC_JEUC,    0, /* Japanese EUC */
  344. #endif /* KANJI */
  345.     "finnish",            FC_FIASCII, 0, /* Finnish NRC */
  346.     "french",             FC_FRASCII, 0, /* French NRC */
  347.     "fr-canadian",        FC_FCASCII, CM_INV, /* French Canadian NRC */
  348.     "german",             FC_GEASCII, 0, /* German NRC */
  349. #ifdef GREEK
  350.     "greek-iso",          FC_GREEK,   0, /* ISO 8859-7 Latin/Greek */
  351. #endif /* GREEK */
  352. #ifdef HEBREW
  353.     "he",                 FC_HEBREW,  CM_ABR|CM_INV,
  354.     "heb",                FC_HEBREW,  CM_ABR|CM_INV,
  355.     "hebr",               FC_HEBREW,  CM_ABR|CM_INV,
  356.     "hebre",              FC_HEBREW,  CM_ABR|CM_INV,
  357.     "hebrew",             FC_HEBREW,  CM_ABR|CM_INV,
  358.     "hebrew-7",           FC_HE7,     0, /* DEC 7-Bit Hebrew */
  359.     "hebrew-iso",         FC_HEBREW,  0, /* ISO Latin/Hebrew */
  360. #endif /* HEBREW */
  361.     "hp-roman8",          FC_HPR8,    0, /* Hewlett Packard Roman8 */
  362.     "hungarian",          FC_HUASCII, 0, /* Hungarian NRC */
  363. #ifdef KANJI
  364.     "iso2022jp-kanji",    FC_JIS7,    0, /* Synonym for JIS-7 */
  365. #endif /* KANJI */
  366.     "italian",            FC_ITASCII, 0, /* Italian NRC */
  367. #ifdef KANJI
  368.     "japanese-euc",       FC_JEUC,    CM_INV, /* Japanese EUC */
  369.     "jis7-kanji",         FC_JIS7,    0, /* Japanese JIS7 7bit code */
  370. #endif /* KANJI */
  371. #ifdef CYRILLIC
  372.     "k",                  FC_KOI8,    CM_ABR|CM_INV,
  373.     "ko",                 FC_KOI8,    CM_ABR|CM_INV,
  374.     "koi",                FC_KOI8,    CM_ABR|CM_INV,
  375.     "koi8",               FC_KOI8,    0, /* Old KOI-8 Cyrillic */
  376.     "koi8-cyrillic",      FC_KOI8,    CM_INV,
  377.     "koi8r",              FC_KOI8R,   0, /* KOI8-R RFC1489 */
  378.     "koi8u",              FC_KOI8U,   0, /* KOI8-U RFC2319 */
  379. #endif /* CYRILLIC */
  380.     "l",                  FC_1LATIN,  CM_ABR|CM_INV,
  381.     "la",                 FC_1LATIN,  CM_ABR|CM_INV,
  382.     "lat",                FC_1LATIN,  CM_ABR|CM_INV,
  383.     "lati",               FC_1LATIN,  CM_ABR|CM_INV,
  384.     "latin",              FC_1LATIN,  CM_ABR|CM_INV,
  385.     "latin1-iso",         FC_1LATIN,  0, /* ISO Latin Alphabet 1 */
  386. #ifdef LATIN2
  387.     "latin2-iso",         FC_2LATIN,  0, /* ISO Latin Alphabet 2 */
  388. #endif /* LATIN2 */
  389.     "latin9-iso",         FC_9LATIN,  0, /* ISO Latin Alphabet 9 */
  390.     "macintosh-latin",    FC_APPQD,   0, /* "Extended Mac Latin" */
  391. #ifdef LATIN2
  392.     "mazovia-pc",         FC_MAZOVIA, 0, /* Polish Mazovia PC code page */
  393. #endif /* LATIN2 */
  394.     "next-multinational", FC_NEXT,    0, /* NeXT workstation */
  395.     "norwegian",          FC_NOASCII, 0, /* Norwegian and Danish NRC */
  396.     "portuguese",         FC_POASCII, 0, /* Portuguese NRC */
  397. #ifdef KANJI
  398.     "shift-jis-kanji",    FC_SHJIS,   0, /* Japanese Kanji Shift-JIS */
  399. #endif /* KANJI */
  400. #ifdef CYRILLIC
  401.     "short-koi",          FC_KOI7,    0, /* Short KOI Cyrillic */
  402. #endif /* CYRILLIC */
  403.     "spanish",            FC_SPASCII, 0, /* Spanish NRC */
  404.     "swedish",            FC_SWASCII, 0, /* Swedish NRC */
  405.     "swiss",              FC_CHASCII, 0, /* Swiss NRC */
  406. #ifdef UNICODE
  407.     "ucs2",               FC_UCS2,    0, /* ISO 10646 / Unicode UCS-2 */
  408.     "utf8",               FC_UTF8,    0, /* ISO 10646 / Unicode UTF-8 */
  409. #endif /* UNICODE */
  410.     "", 0, 0
  411. };
  412. int nfilc = (sizeof(fcstab) / sizeof(struct keytab)) - 1;
  413.  
  414. struct keytab ttcstab[] = { /* Keyword table for SET TERMINAL CHARACTER-SET */
  415. /*
  416.   IMPORTANT: This table is a replica of fcstab, immediately above, with the
  417.   addition of TRANSPARENT and deletion of the Japanese sets.  If you make
  418.   changes to this table, make the corresponding changes to fcstab.
  419. */
  420. /* Keyword               Value       Flags */
  421.     "apple-quickdraw",    FC_APPQD,   CM_INV, /* Apple Quickdraw */
  422.     "ascii",              FC_USASCII, 0, /* ASCII */
  423.     "british",            FC_UKASCII, 0, /* British NRC */
  424.     "bulgaria-pc",        FC_BULGAR,  0, /* Bulgarian PC Code Page */
  425.     "canadian-french",    FC_FCASCII, 0, /* French Canadian NRC */
  426. #ifdef LATIN2
  427.     "cp1250",             FC_CP1250,  0, /* Windows CP 1250 */
  428. #endif /* LATIN2 */
  429. #ifdef CYRILLIC
  430.     "cp1251-cyrillic",    FC_CP1251,  0, /* Windows CP 1251 */
  431. #endif /* CYRILLIC */
  432.     "cp1252",             FC_CP1252,  0, /* Windows CP 1252 */
  433.     "cp437",              FC_CP437,   0, /* IBM CP437 */
  434.     "cp850",              FC_CP850,   0, /* IBM CP850 */
  435. #ifdef LATIN2
  436.     "cp852",              FC_CP852,   0, /* IBM CP852 */
  437. #endif /* LATIN2 */
  438. #ifdef CYRILLIC
  439.     "cp855-cyrillic",     FC_CP855,   0, /* PC CP855 */
  440. #endif /* CYRILLIC */
  441.     "cp858",              FC_CP858,   0, /* PC CP858 */
  442. #ifdef HEBREW
  443.     "cp862-hebrew",       FC_CP862,   0, /* PC CP862 */
  444. #endif /* HEBREW */
  445. #ifdef CYRILLIC
  446.     "cp866-cyrillic",     FC_CP866,   0, /* CP866 Cyrillic */
  447. #endif /* CYRILLIC */
  448. #ifdef GREEK
  449.     "cp869-greek",        FC_CP869,   0, /* CP869 Greek */
  450. #endif /* GREEK */
  451. #ifdef CYRILLIC
  452.     "cyrillic-iso",       FC_CYRILL,  0, /* ISO Latin/Cyrillic Alphabet */
  453. #endif /* CYRILLIC */
  454.     "danish",             FC_NOASCII, 0, /* Norwegian and Danish NRC */
  455. #ifdef COMMENT
  456. #ifdef KANJI
  457.     "dec-kanji",          FC_JDEC,    0, /* Japanese DEC Kanji */
  458. #endif /* KANJI */
  459. #endif /* COMMENT */
  460.     "dec-multinational",  FC_DECMCS,  0, /* DEC multinational character set */
  461.     "dg-international",   FC_DGMCS,   0, /* Data General multinational */
  462.     "dutch",              FC_DUASCII, 0, /* Dutch NRC */
  463. #ifdef GREEK
  464.     "elot927-greek",      FC_ELOT,    0, /* ELOT 927 Greek */
  465.     "elot928-greek",      FC_GREEK,   0, /* Same as ISO 8859-7 Latin/Greek */
  466. #endif /* GREEK */
  467.     "finnish",            FC_FIASCII, 0, /* Finnish NRC */
  468.     "french",             FC_FRASCII, 0, /* French NRC */
  469.     "fr-canadian",        FC_FCASCII, CM_INV, /* French Canadian NRC */
  470.     "german",             FC_GEASCII, 0, /* German NRC */
  471. #ifdef GREEK
  472.     "greek-iso",          FC_GREEK,   0, /* ISO 8859-7 Latin/Greek */
  473. #endif /* GREEK */
  474. #ifdef HEBREW
  475.     "he",                 FC_HEBREW,  CM_ABR|CM_INV,
  476.     "heb",                FC_HEBREW,  CM_ABR|CM_INV,
  477.     "hebr",               FC_HEBREW,  CM_ABR|CM_INV,
  478.     "hebre",              FC_HEBREW,  CM_ABR|CM_INV,
  479.     "hebrew",             FC_HEBREW,  CM_ABR|CM_INV,
  480.     "hebrew-7",           FC_HE7,     0, /* DEC 7-Bit Hebrew */
  481.     "hebrew-iso",         FC_HEBREW,  0, /* ISO Latin/Hebrew */
  482. #endif /* HEBREW */
  483.     "hp-roman8",          FC_HPR8,    0, /* Hewlett Packard Roman8 */
  484.     "hungarian",          FC_HUASCII, 0, /* Hungarian NRC */
  485.     "italian",            FC_ITASCII, 0, /* Italian NRC */
  486. #ifdef COMMENT
  487. /* Kanji terminal character sets not implemented yet */
  488. #ifdef KANJI
  489.     "japanese-euc",       FC_JEUC,    0, /* Japanese EUC */
  490.     "jis7-kanji",         FC_JIS7,    0, /* Japanese JIS7 7bit code */
  491. #endif /* KANJI */
  492. #endif /* COMMENT */
  493. #ifdef CYRILLIC
  494.     "k",                  FC_KOI8,    CM_ABR|CM_INV,
  495.     "ko",                 FC_KOI8,    CM_ABR|CM_INV,
  496.     "koi",                FC_KOI8,    CM_ABR|CM_INV,
  497.     "koi8",               FC_KOI8,    0, /* Old KOI-8 Cyrillic */
  498.     "koi8-cyrillic",      FC_KOI8,    CM_INV,
  499.     "koi8r",              FC_KOI8R,   0, /* KOI8-R RFC1489 */
  500.     "koi8u",              FC_KOI8U,   0, /* KOI8-U RFC2319 */
  501. #endif /* CYRILLIC */
  502.     "l",                  FC_1LATIN,  CM_ABR|CM_INV,
  503.     "la",                 FC_1LATIN,  CM_ABR|CM_INV,
  504.     "lat",                FC_1LATIN,  CM_ABR|CM_INV,
  505.     "lati",               FC_1LATIN,  CM_ABR|CM_INV,
  506.     "latin",              FC_1LATIN,  CM_ABR|CM_INV,
  507.     "latin1-iso",         FC_1LATIN,  0, /* ISO Latin Alphabet 1 */
  508. #ifdef LATIN2
  509.     "latin2-iso",         FC_2LATIN,  0, /* ISO Latin Alphabet 2 */
  510. #endif /* LATIN2 */
  511.     "latin9-iso",         FC_9LATIN,  0, /* ISO Latin Alphabet 9 */
  512.     "macintosh-latin",    FC_APPQD,   0, /* "Extended Mac Latin */
  513. #ifdef LATIN2
  514.     "mazovia-pc",         FC_MAZOVIA, 0, /* Polish Mazovia PC code page */
  515. #endif /* LATIN2 */
  516.     "next-multinational", FC_NEXT,    0, /* NeXT workstation */
  517.     "norwegian",          FC_NOASCII, 0, /* Norwegian and Danish NRC */
  518.     "portuguese",         FC_POASCII, 0, /* Portuguese NRC */
  519. #ifdef COMMENT
  520. /* Kanji terminal character sets not implemented yet. */
  521. #ifdef KANJI
  522.     "shift-jis-kanji",    FC_SHJIS,   0, /* Japanese Kanji Shift-JIS */
  523. #endif /* KANJI */
  524. #endif /* COMMENT */
  525. #ifdef CYRILLIC
  526.     "short-koi",          FC_KOI7,    0, /* Short KOI Cyrillic */
  527. #endif /* CYRILLIC */
  528.     "spanish",            FC_SPASCII, 0, /* Spanish NRC */
  529.     "swedish",            FC_SWASCII, 0, /* Swedish NRC */
  530.     "swiss",              FC_CHASCII, 0, /* Swiss NRC */
  531.     "transparent",        FC_TRANSP,  0, /* Transparent */
  532. #ifdef UNICODE
  533.     "utf8",               FC_UTF8,    0, /* ISO 10646 / Unicode UTF-8 */
  534. #endif /* UNICODE */
  535.     "", 0, 0
  536. };
  537. int ntermc = (sizeof(ttcstab) / sizeof(struct keytab)) - 1;
  538.  
  539. /* This table contains the equivalent FCS number for each TCS. */
  540. /* If the TC_xxx symbol definitions are ever changed, fix this table. */
  541. /* Ditto if another TCS is added. */
  542.  
  543. int
  544. cseqtab[MAXTCSETS+1] = {        /* TCS/FCS equivalency table */
  545.     -1,                    /*  0 = Transparent */
  546.     FC_USASCII,                /*  1 = ASCII */
  547.     FC_1LATIN,                /*  2 = Latin-1 */
  548.     FC_2LATIN,                /*  3 = Latin-2 */
  549.     FC_CYRILL,                /*  4 = Latin/Cyrillic */
  550.     FC_JEUC,                /*  5 = Japanese EUC */
  551.     FC_HEBREW,                /*  6 = Latin/Hebrew */
  552.     FC_GREEK,                /*  7 = Latin/Greek */
  553.     FC_9LATIN,                /*  8 = Latin-9 */
  554.     FC_UCS2,                /*  9 = UCS-2 */
  555.     FC_UTF8                /* 10 = UTF-8 */
  556. };
  557.  
  558. /*
  559.  Languages:
  560.  
  561.  This table allows C-Kermit to have a SET LANGUAGE command to apply special
  562.  language-specific rules when translating from a character set that contains
  563.  national characters into plain ASCII, like German umlaut-a becomes ae.
  564.  
  565.  Originally, I thought it would be a good idea to let SET LANGUAGE also select
  566.  an appropriate FILE CHARACTER-SET and TRANSFER CHARACTER-SET automatically,
  567.  and these are included in the langinfo structure.  Later I realized that this
  568.  was a bad idea.  Any particular language (e.g. Dutch) can be represented by
  569.  many different and incompatible character sets.
  570.  
  571.  (But we could use the new (1998) ASSOCIATE command for this...)
  572. */
  573.  
  574. struct langinfo langs[] = {
  575. /*  Language code   File Charset Xfer Charset Name */
  576.     L_USASCII,      FC_USASCII,  TC_USASCII,  "ASCII (American English)",
  577.     L_DANISH,       FC_NOASCII,  TC_1LATIN,   "Danish",
  578.     L_DUTCH,        FC_DUASCII,  TC_1LATIN,   "Dutch",
  579.     L_FINNISH,      FC_FIASCII,  TC_1LATIN,   "Finnish",
  580.     L_FRENCH,       FC_FRASCII,  TC_1LATIN,   "French",
  581.     L_GERMAN,       FC_GEASCII,  TC_1LATIN,   "German",
  582. #ifdef GREEK
  583.     L_GREEK,        FC_GREEK,    TC_GREEK,    "Greek",
  584. #endif /* GREEK */
  585. #ifdef HEBREW
  586.     L_HEBREW,       FC_HEBREW,   TC_HEBREW,   "Hebrew",
  587. #endif /* HEBREW */
  588.     L_HUNGARIAN,    FC_HUASCII,  TC_2LATIN,   "Hungarian",
  589.     L_ICELANDIC,    FC_USASCII,  TC_1LATIN,   "Icelandic",
  590.     L_ITALIAN,      FC_ITASCII,  TC_1LATIN,   "Italian",
  591. #ifdef KANJI
  592.     L_JAPANESE,     FC_JEUC,     TC_JEUC,     "Japanese",
  593. #endif /* KANJI */
  594.     L_NORWEGIAN,    FC_NOASCII,  TC_1LATIN,   "Norwegian",
  595.     L_PORTUGUESE,   FC_POASCII,  TC_1LATIN,   "Portuguese",
  596. #ifdef CYRILLIC
  597.     L_RUSSIAN,      FC_CP866,    TC_CYRILL,   "Russian",
  598. #endif /* CYRILLIC */
  599.     L_SPANISH,      FC_SPASCII,  TC_1LATIN,   "Spanish",
  600.     L_SWEDISH,      FC_SWASCII,  TC_1LATIN,   "Swedish",
  601.     L_SWISS,        FC_CHASCII,  TC_1LATIN,   "Swiss"
  602. };
  603. int nlangs = (sizeof(langs) / sizeof(struct langinfo));
  604.  
  605. /*
  606.   Keyword table for the SET LANGUAGE command.
  607.   Only a few of these (German, Scandinavian, etc) actually do anything.
  608.   The language is used to invoke special translation rules when converting
  609.   from an 8-bit character set to ASCII; for example, German u-diaeresis
  610.   becomes "ue", Dutch y-diaeresis becomes "ij".  Languages without associated
  611.   rules are invisible (CM_INV).
  612. */
  613. struct keytab lngtab[] = {
  614.     "ascii",            L_USASCII,    CM_INV,
  615.     "danish",           L_DANISH,     0,
  616.     "dutch",            L_DUTCH,      0,
  617.     "english",          L_USASCII,    CM_INV,
  618.     "finnish",          L_FINNISH,    0,
  619.     "french",           L_FRENCH,     0,
  620.     "german",           L_GERMAN,     0,
  621. #ifdef GREEK
  622.     "greek",            L_GREEK,      CM_INV,
  623. #endif /* GREEK */
  624. #ifdef HEBREW
  625.     "hebrew",           L_HEBREW,     CM_INV,
  626. #endif /* HEBREW */
  627.     "hungarian",        L_HUNGARIAN,  CM_INV,
  628.     "icelandic",        L_ICELANDIC,  0,
  629.     "italian",          L_ITALIAN,    CM_INV,
  630. #ifdef KANJI
  631.     "japanese",         L_JAPANESE,   CM_INV,
  632. #endif /* KANJI */
  633.     "norwegian",        L_NORWEGIAN,  0,
  634.     "none",             L_USASCII,    0,
  635.     "portuguese",       L_PORTUGUESE, CM_INV,
  636. #ifdef CYRILLIC
  637.     "russian",          L_RUSSIAN,    0,
  638. #endif /* CYRILLIC */
  639.     "spanish",          L_SPANISH,    CM_INV,
  640.     "swedish",          L_SWEDISH,    0,
  641. #ifdef CYRILLIC
  642.     "ukrainian",        L_RUSSIAN,    0,
  643. #endif /* CYRILLIC */
  644.     "", 0, 0
  645. };
  646. int nlng = (sizeof(lngtab) / sizeof(struct keytab)) - 1; /* how many */
  647.  
  648.  
  649. /* Translation tables ... */
  650.  
  651. /*
  652.   For each pair of (transfer,file) character sets, we need two translation
  653.   functions, one for sending, one for receiving.
  654. */
  655.  
  656. /*
  657.   Here is the first table, Latin-1 to ASCII, fully annotated...
  658.   This one is absolutely NOT invertible, since we're going from an 8-bit
  659.   set to a 7-bit set.  Accented letters are mapped to unaccented
  660.   equivalents, C1 control characters are all translated to "?", etc.
  661. */
  662. CONST CHAR
  663. yl1as[] = {  /* ISO 8859-1 Latin Alphabet 1 to US ASCII */
  664.       /*  Source character    Description               => Translation */
  665.       /*  Dec row/col Set                                           */
  666.   0,  /*  000  00/00  C0 NUL  Ctrl-@                    =>  (self)  */
  667.   1,  /*  001  00/01  C0 SOH  Ctrl-A                    =>  (self)  */
  668.   2,  /*  002  00/02  C0 STX  Ctrl-B                    =>  (self)  */
  669.   3,  /*  003  00/03  C0 ETX  Ctrl-C                    =>  (self)  */
  670.   4,  /*  004  00/04  C0 EOT  Ctrl-D                    =>  (self)  */
  671.   5,  /*  005  00/05  C0 ENQ  Ctrl-E                    =>  (self)  */
  672.   6,  /*  006  00/06  C0 ACK  Ctrl-F                    =>  (self)  */
  673.   7,  /*  007  00/07  C0 BEL  Ctrl-G                    =>  (self)  */
  674.   8,  /*  008  00/08  C0 BS   Ctrl-H                    =>  (self)  */
  675.   9,  /*  009  00/09  C0 HT   Ctrl-I                    =>  (self)  */
  676.  10,  /*  010  00/10  C0 LF   Ctrl-J                    =>  (self)  */
  677.  11,  /*  011  00/11  C0 VT   Ctrl-K                    =>  (self)  */
  678.  12,  /*  012  00/12  C0 FF   Ctrl-L                    =>  (self)  */
  679.  13,  /*  013  00/13  C0 CR   Ctrl-M                    =>  (self)  */
  680.  14,  /*  014  00/14  C0 SO   Ctrl-N                    =>  (self)  */
  681.  15,  /*  015  00/15  C0 SI   Ctrl-O                    =>  (self)  */
  682.  16,  /*  016  01/00  C0 DLE  Ctrl-P                    =>  (self)  */
  683.  17,  /*  017  01/01  C0 DC1  Ctrl-Q                    =>  (self)  */
  684.  18,  /*  018  01/02  C0 DC2  Ctrl-R                    =>  (self)  */
  685.  19,  /*  019  01/03  C0 DC3  Ctrl-S                    =>  (self)  */
  686.  20,  /*  020  01/04  C0 DC4  Ctrl-T                    =>  (self)  */
  687.  21,  /*  021  01/05  C0 NAK  Ctrl-U                    =>  (self)  */
  688.  22,  /*  022  01/06  C0 SYN  Ctrl-V                    =>  (self)  */
  689.  23,  /*  023  01/07  C0 ETB  Ctrl-W                    =>  (self)  */
  690.  24,  /*  024  01/08  C0 CAN  Ctrl-X                    =>  (self)  */
  691.  25,  /*  025  01/09  C0 EM   Ctrl-Y                    =>  (self)  */
  692.  26,  /*  026  01/10  C0 SUB  Ctrl-Z                    =>  (self)  */
  693.  27,  /*  027  01/11  C0 ESC  Ctrl-[                    =>  (self)  */
  694.  28,  /*  028  01/12  C0 FS   Ctrl-\                    =>  (self)  */
  695.  29,  /*  029  01/13  C0 GS   Ctrl-]                    =>  (self)  */
  696.  30,  /*  030  01/14  C0 RS   Ctrl-^                    =>  (self)  */
  697.  31,  /*  031  01/15  C0 US   Ctrl-_                    =>  (self)  */
  698.  32,  /*  032  02/00     SP   Space                     =>  (self)  */
  699.  33,  /*  033  02/01  G0 !    Exclamation mark          =>  (self)  */
  700.  34,  /*  034  02/02  G0 "    Doublequote               =>  (self)  */
  701.  35,  /*  035  02/03  G0 #    Number sign               =>  (self)  */
  702.  36,  /*  036  02/04  G0 $    Dollar sign               =>  (self)  */
  703.  37,  /*  037  02/05  G0 %    Percent sign              =>  (self)  */
  704.  38,  /*  038  02/06  G0 &    Ampersand                 =>  (self)  */
  705.  39,  /*  039  02/07  G0 '    Apostrophe                =>  (self)  */
  706.  40,  /*  040  02/08  G0 (    Left parenthesis          =>  (self)  */
  707.  41,  /*  041  02/09  G0 )    Right parenthesis         =>  (self)  */
  708.  42,  /*  042  02/10  G0 *    Asterisk                  =>  (self)  */
  709.  43,  /*  043  02/11  G0 +    Plus sign                 =>  (self)  */
  710.  44,  /*  044  02/12  G0 ,    Comma                     =>  (self)  */
  711.  45,  /*  045  02/13  G0 -    Hyphen, minus sign        =>  (self)  */
  712.  46,  /*  046  02/14  G0 .    Period, full stop         =>  (self)  */
  713.  47,  /*  047  02/15  G0 /    Slash, solidus            =>  (self)  */
  714.  48,  /*  048  03/00  G0 0    Digit 0                   =>  (self)  */
  715.  49,  /*  049  03/01  G0 1    Digit 1                   =>  (self)  */
  716.  50,  /*  050  03/02  G0 2    Digit 2                   =>  (self)  */
  717.  51,  /*  051  03/03  G0 3    Digit 3                   =>  (self)  */
  718.  52,  /*  052  03/04  G0 4    Digit 4                   =>  (self)  */
  719.  53,  /*  053  03/05  G0 5    Digit 5                   =>  (self)  */
  720.  54,  /*  054  03/06  G0 6    Digit 6                   =>  (self)  */
  721.  55,  /*  055  03/07  G0 7    Digit 7                   =>  (self)  */
  722.  56,  /*  056  03/08  G0 8    Digit 8                   =>  (self)  */
  723.  57,  /*  057  03/09  G0 9    Digit 9                   =>  (self)  */
  724.  58,  /*  058  03/10  G0 :    Colon                     =>  (self)  */
  725.  59,  /*  059  03/11  G0 ;    Semicolon                 =>  (self)  */
  726.  60,  /*  060  03/12  G0 <    Less-than sign            =>  (self)  */
  727.  61,  /*  061  03/13  G0 =    Equals sign               =>  (self)  */
  728.  62,  /*  062  03/14  G0 >    Greater-than sign         =>  (self)  */
  729.  63,  /*  063  03/15  G0 ?    Question mark             =>  (self)  */
  730.  64,  /*  064  04/00  G0 @    Commercial at sign        =>  (self)  */
  731.  65,  /*  065  04/01  G0 A    Letter A                  =>  (self)  */
  732.  66,  /*  066  04/02  G0 B    Letter B                  =>  (self)  */
  733.  67,  /*  067  04/03  G0 C    Letter C                  =>  (self)  */
  734.  68,  /*  068  04/04  G0 D    Letter D                  =>  (self)  */
  735.  69,  /*  069  04/05  G0 E    Letter E                  =>  (self)  */
  736.  70,  /*  070  04/06  G0 F    Letter F                  =>  (self)  */
  737.  71,  /*  071  04/07  G0 G    Letter G                  =>  (self)  */
  738.  72,  /*  072  04/08  G0 H    Letter H                  =>  (self)  */
  739.  73,  /*  073  04/09  G0 I    Letter I                  =>  (self)  */
  740.  74,  /*  074  04/10  G0 J    Letter J                  =>  (self)  */
  741.  75,  /*  075  04/11  G0 K    Letter K                  =>  (self)  */
  742.  76,  /*  076  04/12  G0 L    Letter L                  =>  (self)  */
  743.  77,  /*  077  04/13  G0 M    Letter M                  =>  (self)  */
  744.  78,  /*  078  04/14  G0 N    Letter N                  =>  (self)  */
  745.  79,  /*  079  04/15  G0 O    Letter O                  =>  (self)  */
  746.  80,  /*  080  05/00  G0 P    Letter P                  =>  (self)  */
  747.  81,  /*  081  05/01  G0 Q    Letter Q                  =>  (self)  */
  748.  82,  /*  082  05/02  G0 R    Letter R                  =>  (self)  */
  749.  83,  /*  083  05/03  G0 S    Letter S                  =>  (self)  */
  750.  84,  /*  084  05/04  G0 T    Letter T                  =>  (self)  */
  751.  85,  /*  085  05/05  G0 U    Letter U                  =>  (self)  */
  752.  86,  /*  086  05/06  G0 V    Letter V                  =>  (self)  */
  753.  87,  /*  087  05/07  G0 W    Letter W                  =>  (self)  */
  754.  88,  /*  088  05/08  G0 X    Letter X                  =>  (self)  */
  755.  89,  /*  089  05/09  G0 Y    Letter Y                  =>  (self)  */
  756.  90,  /*  090  05/10  G0 Z    Letter Z                  =>  (self)  */
  757.  91,  /*  091  05/11  G0 [    Left square bracket       =>  (self)  */
  758.  92,  /*  092  05/12  G0 \    Reverse slash             =>  (self)  */
  759.  93,  /*  093  05/13  G0 ]    Right square bracket      =>  (self)  */
  760.  94,  /*  094  05/14  G0 ^    Circumflex accent         =>  (self)  */
  761.  95,  /*  095  05/15  G0 _    Underline, low line       =>  (self)  */
  762.  96,  /*  096  06/00  G0 `    Grave accent              =>  (self)  */
  763.  97,  /*  097  06/01  G0 a    Letter a                  =>  (self)  */
  764.  98,  /*  098  06/02  G0 b    Letter b                  =>  (self)  */
  765.  99,  /*  099  06/03  G0 c    Letter c                  =>  (self)  */
  766. 100,  /*  100  06/04  G0 d    Letter d                  =>  (self)  */
  767. 101,  /*  101  06/05  G0 e    Letter e                  =>  (self)  */
  768. 102,  /*  102  06/06  G0 f    Letter f                  =>  (self)  */
  769. 103,  /*  103  06/07  G0 g    Letter g                  =>  (self)  */
  770. 104,  /*  104  06/08  G0 h    Letter h                  =>  (self)  */
  771. 105,  /*  105  06/09  G0 i    Letter i                  =>  (self)  */
  772. 106,  /*  106  06/10  G0 j    Letter j                  =>  (self)  */
  773. 107,  /*  107  06/11  G0 k    Letter k                  =>  (self)  */
  774. 108,  /*  108  06/12  G0 l    Letter l                  =>  (self)  */
  775. 109,  /*  109  06/13  G0 m    Letter m                  =>  (self)  */
  776. 110,  /*  110  06/14  G0 n    Letter n                  =>  (self)  */
  777. 111,  /*  111  06/15  G0 o    Letter o                  =>  (self)  */
  778. 112,  /*  112  07/00  G0 p    Letter p                  =>  (self)  */
  779. 113,  /*  113  07/01  G0 q    Letter q                  =>  (self)  */
  780. 114,  /*  114  07/02  G0 r    Letter r                  =>  (self)  */
  781. 115,  /*  115  07/03  G0 s    Letter s                  =>  (self)  */
  782. 116,  /*  116  07/04  G0 t    Letter t                  =>  (self)  */
  783. 117,  /*  117  07/05  G0 u    Letter u                  =>  (self)  */
  784. 118,  /*  118  07/06  G0 v    Letter v                  =>  (self)  */
  785. 119,  /*  119  07/07  G0 w    Letter w                  =>  (self)  */
  786. 120,  /*  120  07/08  G0 x    Letter x                  =>  (self)  */
  787. 121,  /*  121  07/09  G0 y    Letter y                  =>  (self)  */
  788. 122,  /*  122  07/10  G0 z    Letter z                  =>  (self)  */
  789. 123,  /*  123  07/11  G0 {    Left curly bracket        =>  (self)  */
  790. 124,  /*  124  07/12  G0 |    Vertical bar              =>  (self)  */
  791. 125,  /*  125  07/13  G0 }    Right curly bracket       =>  (self)  */
  792. 126,  /*  126  07/14  G0 ~    Tilde                     =>  (self)  */
  793. 127,  /*  127  07/15     DEL  Delete, Rubout            =>  (self)  */
  794. UNK,  /*  128  08/00  C1                                =>  UNK     */
  795. UNK,  /*  129  08/01  C1                                =>  UNK     */
  796. UNK,  /*  130  08/02  C1                                =>  UNK     */
  797. UNK,  /*  131  08/03  C1                                =>  UNK     */
  798. UNK,  /*  132  08/04  C1 IND                            =>  UNK     */
  799. UNK,  /*  133  08/05  C1 NEL                            =>  UNK     */
  800. UNK,  /*  134  08/06  C1 SSA                            =>  UNK     */
  801. UNK,  /*  135  08/07  C1 ESA                            =>  UNK     */
  802. UNK,  /*  136  08/08  C1 HTS                            =>  UNK     */
  803. UNK,  /*  137  08/09  C1                                =>  UNK     */
  804. UNK,  /*  138  08/10  C1                                =>  UNK     */
  805. UNK,  /*  139  08/11  C1                                =>  UNK     */
  806. UNK,  /*  140  08/12  C1                                =>  UNK     */
  807. UNK,  /*  141  08/13  C1 RI                             =>  UNK     */
  808. UNK,  /*  142  08/14  C1 SS2                            =>  UNK     */
  809. UNK,  /*  143  08/15  C1 SS3                            =>  UNK     */
  810. UNK,  /*  144  09/00  C1 DCS                            =>  UNK     */
  811. UNK,  /*  145  09/01  C1                                =>  UNK     */
  812. UNK,  /*  146  09/02  C1                                =>  UNK     */
  813. UNK,  /*  147  09/03  C1 STS                            =>  UNK     */
  814. UNK,  /*  148  09/04  C1                                =>  UNK     */
  815. UNK,  /*  149  09/05  C1                                =>  UNK     */
  816. UNK,  /*  150  09/06  C1 SPA                            =>  UNK     */
  817. UNK,  /*  151  09/07  C1 EPA                            =>  UNK     */
  818. UNK,  /*  152  09/08  C1                                =>  UNK     */
  819. UNK,  /*  153  09/09  C1                                =>  UNK     */
  820. UNK,  /*  154  09/10  C1                                =>  UNK     */
  821. UNK,  /*  155  09/11  C1 CSI                            =>  UNK     */
  822. UNK,  /*  156  09/12  C1 ST                             =>  UNK     */
  823. UNK,  /*  157  09/13  C1 OSC                            =>  UNK     */
  824. UNK,  /*  158  09/14  C1 PM                             =>  UNK     */
  825. UNK,  /*  159  09/15  C1 APC                            =>  UNK     */
  826.  32,  /*  160  10/00  G1      No-break space            =>  SP      */
  827.  33,  /*  161  10/01  G1      Inverted exclamation      =>  !       */
  828.  99,  /*  162  10/02  G1      Cent sign                 =>  c       */
  829.  35,  /*  163  10/03  G1      Pound sign                =>  #       */
  830.  36,  /*  164  10/04  G1      Currency sign             =>  $       */
  831.  89,  /*  165  10/05  G1      Yen sign                  =>  Y       */
  832. 124,  /*  166  10/06  G1      Broken bar                =>  |       */
  833.  80,  /*  167  10/07  G1      Paragraph sign            =>  P       */
  834.  34,  /*  168  10/08  G1      Diaeresis                 =>  "       */
  835.  67,  /*  169  10/09  G1      Copyright sign            =>  C       */
  836.  97,  /*  170  10/10  G1      Feminine ordinal          =>  a       */
  837.  34,  /*  171  10/11  G1      Left angle quotation      =>  "       */
  838. 126,  /*  172  10/12  G1      Not sign                  =>  ~       */
  839.  45,  /*  173  10/13  G1      Soft hyphen               =>  -       */
  840.  82,  /*  174  10/14  G1      Registered trade mark     =>  R       */
  841.  95,  /*  175  10/15  G1      Macron                    =>  _       */
  842. 111,  /*  176  11/00  G1      Degree sign, ring above   =>  o       */
  843. UNK,  /*  177  11/01  G1      Plus-minus sign           =>  UNK     */
  844.  50,  /*  178  11/02  G1      Superscript two           =>  2       */
  845.  51,  /*  179  11/03  G1      Superscript three         =>  3       */
  846.  39,  /*  180  11/04  G1      Acute accent              =>  '       */
  847. 117,  /*  181  11/05  G1      Micro sign                =>  u       */
  848.  45,  /*  182  11/06  G1      Pilcrow sign              =>  -       */
  849.  45,  /*  183  11/07  G1      Middle dot                =>  -       */
  850.  44,  /*  184  11/08  G1      Cedilla                   =>  ,       */
  851.  49,  /*  185  11/09  G1      Superscript one           =>  1       */
  852. 111,  /*  186  11/10  G1      Masculine ordinal         =>  o       */
  853.  34,  /*  187  11/11  G1      Right angle quotation     =>  "       */
  854. UNK,  /*  188  11/12  G1      One quarter               =>  UNK     */
  855. UNK,  /*  189  11/13  G1      One half                  =>  UNK     */
  856. UNK,  /*  190  11/14  G1      Three quarters            =>  UNK     */
  857.  63,  /*  191  11/15  G1      Inverted question mark    =>  ?       */
  858.  65,  /*  192  12/00  G1      A grave                   =>  A       */
  859.  65,  /*  193  12/01  G1      A acute                   =>  A       */
  860.  65,  /*  194  12/02  G1      A circumflex              =>  A       */
  861.  65,  /*  195  12/03  G1      A tilde                   =>  A       */
  862.  65,  /*  196  12/04  G1      A diaeresis               =>  A       */
  863.  65,  /*  197  12/05  G1      A ring above              =>  A       */
  864.  65,  /*  198  12/06  G1      A with E                  =>  A       */
  865.  67,  /*  199  12/07  G1      C Cedilla                 =>  C       */
  866.  69,  /*  200  12/08  G1      E grave                   =>  E       */
  867.  69,  /*  201  12/09  G1      E acute                   =>  E       */
  868.  69,  /*  202  12/10  G1      E circumflex              =>  E       */
  869.  69,  /*  203  12/11  G1      E diaeresis               =>  E       */
  870.  73,  /*  204  12/12  G1      I grave                   =>  I       */
  871.  73,  /*  205  12/13  G1      I acute                   =>  I       */
  872.  73,  /*  206  12/14  G1      I circumflex              =>  I       */
  873.  73,  /*  207  12/15  G1      I diaeresis               =>  I       */
  874.  68,  /*  208  13/00  G1      Icelandic Eth             =>  D       */
  875.  78,  /*  209  13/01  G1      N tilde                   =>  N       */
  876.  79,  /*  210  13/02  G1      O grave                   =>  O       */
  877.  79,  /*  211  13/03  G1      O acute                   =>  O       */
  878.  79,  /*  212  13/04  G1      O circumflex              =>  O       */
  879.  79,  /*  213  13/05  G1      O tilde                   =>  O       */
  880.  79,  /*  214  13/06  G1      O diaeresis               =>  O       */
  881. 120,  /*  215  13/07  G1      Multiplication sign       =>  x       */
  882.  79,  /*  216  13/08  G1      O oblique stroke          =>  O       */
  883.  85,  /*  217  13/09  G1      U grave                   =>  U       */
  884.  85,  /*  218  13/10  G1      U acute                   =>  U       */
  885.  85,  /*  219  13/11  G1      U circumflex              =>  U       */
  886.  85,  /*  220  13/12  G1      U diaeresis               =>  U       */
  887.  89,  /*  221  13/13  G1      Y acute                   =>  Y       */
  888.  84,  /*  222  13/14  G1      Icelandic Thorn           =>  T       */
  889. 115,  /*  223  13/15  G1      German sharp s            =>  s       */
  890.  97,  /*  224  14/00  G1      a grave                   =>  a       */
  891.  97,  /*  225  14/01  G1      a acute                   =>  a       */
  892.  97,  /*  226  14/02  G1      a circumflex              =>  a       */
  893.  97,  /*  227  14/03  G1      a tilde                   =>  a       */
  894.  97,  /*  228  14/04  G1      a diaeresis               =>  a       */
  895.  97,  /*  229  14/05  G1      a ring above              =>  a       */
  896.  97,  /*  230  14/06  G1      a with e                  =>  a       */
  897.  99,  /*  231  14/07  G1      c cedilla                 =>  c       */
  898. 101,  /*  232  14/08  G1      e grave                   =>  e       */
  899. 101,  /*  233  14/09  G1      e acute                   =>  e       */
  900. 101,  /*  234  14/10  G1      e circumflex              =>  e       */
  901. 101,  /*  235  14/11  G1      e diaeresis               =>  e       */
  902. 105,  /*  236  14/12  G1      i grave                   =>  i       */
  903. 105,  /*  237  14/13  G1      i acute                   =>  i       */
  904. 105,  /*  238  14/14  G1      i circumflex              =>  i       */
  905. 105,  /*  239  14/15  G1      i diaeresis               =>  i       */
  906. 100,  /*  240  15/00  G1      Icelandic eth             =>  d       */
  907. 110,  /*  241  15/01  G1      n tilde                   =>  n       */
  908. 111,  /*  242  15/02  G1      o grave                   =>  o       */
  909. 111,  /*  243  15/03  G1      o acute                   =>  o       */
  910. 111,  /*  244  15/04  G1      o circumflex              =>  o       */
  911. 111,  /*  245  15/05  G1      o tilde                   =>  o       */
  912. 111,  /*  246  15/06  G1      o diaeresis               =>  o       */
  913.  47,  /*  247  15/07  G1      Division sign             =>  /       */
  914. 111,  /*  248  15/08  G1      o oblique stroke          =>  o       */
  915. 117,  /*  249  15/09  G1      u grave                   =>  u       */
  916. 117,  /*  250  15/10  G1      u acute                   =>  u       */
  917. 117,  /*  251  15/11  G1      u circumflex              =>  u       */
  918. 117,  /*  252  15/12  G1      u diaeresis               =>  u       */
  919. 121,  /*  253  15/13  G1      y acute                   =>  y       */
  920. 116,  /*  254  15/14  G1      Icelandic thorn           =>  t       */
  921. 121   /*  255  15/15  G1      y diaeresis               =>  y       */
  922. };
  923.  
  924.  
  925. /* Translation tables for ISO Latin Alphabet 1 to local file character sets */
  926.  
  927. /*
  928.   Most of the remaining tables are not annotated like the one above, because
  929.   the size of the resulting source file would be ridiculous.  Each row in the
  930.   following tables corresponds to a column of ISO 8859-1.
  931. */
  932.  
  933. CONST CHAR
  934. yl185[] = {  /* ISO 8859-1 Latin Alphabet 1 (Latin-1) to IBM Code Page 850 */
  935. /*
  936.   This is based on IBM's official invertible translation.  Reference: IBM
  937.   Character Data Representation Architecture (CDRA), Level 1, Registry,
  938.   SC09-1291-00 (1990), p.152.  (Note: Latin-1 is IBM Code Page 00819.)  Note:
  939.   IBM's bizarre rearrangement of C0 controls and DEL has been undone in this
  940.   table.
  941. */
  942.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  943.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  944.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  945.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  946.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  947.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  948.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  949. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  950. 186, 205, 201, 187, 200, 188, 204, 185, 203, 202, 206, 223, 220, 219, 254, 242,
  951. 179, 196, 218, 191, 192, 217, 195, 180, 194, 193, 197, 176, 177, 178, 213, 159,
  952. 255, 173, 189, 156, 207, 190, 221, 245, 249, 184, 166, 174, 170, 240, 169, 238,
  953. 248, 241, 253, 252, 239, 230, 244, 250, 247, 251, 167, 175, 172, 171, 243, 168,
  954. 183, 181, 182, 199, 142, 143, 146, 128, 212, 144, 210, 211, 222, 214, 215, 216,
  955. 209, 165, 227, 224, 226, 229, 153, 158, 157, 235, 233, 234, 154, 237, 232, 225,
  956. 133, 160, 131, 198, 132, 134, 145, 135, 138, 130, 136, 137, 141, 161, 140, 139,
  957. 208, 164, 149, 162, 147, 228, 148, 246, 155, 151, 163, 150, 129, 236, 231, 152
  958. };
  959.  
  960. CONST CHAR
  961. y85l1[] = {  /* IBM Code Page 850 to Latin-1 */
  962. /*
  963.   This is from IBM CDRA page 153.  It is the inverse of yl185[].
  964.   As of edit 183, this table is no longer pure CDRA.  The translations
  965.   involving C0 controls and DEL have been removed.
  966. */
  967.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  968.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  969.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  970.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  971.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  972.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  973.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  974. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  975. 199, 252, 233, 226, 228, 224, 229, 231, 234, 235, 232, 239, 238, 236, 196, 197,
  976. 201, 230, 198, 244, 246, 242, 251, 249, 255, 214, 220, 248, 163, 216, 215, 159,
  977. 225, 237, 243, 250, 241, 209, 170, 186, 191, 174, 172, 189, 188, 161, 171, 187,
  978. 155, 156, 157, 144, 151, 193, 194, 192, 169, 135, 128, 131, 133, 162, 165, 147,
  979. 148, 153, 152, 150, 145, 154, 227, 195, 132, 130, 137, 136, 134, 129, 138, 164,
  980. 240, 208, 202, 203, 200, 158, 205, 206, 207, 149, 146, 141, 140, 166, 204, 139,
  981. 211, 223, 212, 210, 245, 213, 181, 254, 222, 218, 219, 217, 253, 221, 175, 180,
  982. 173, 177, 143, 190, 182, 167, 247, 184, 176, 168, 183, 185, 179, 178, 142, 160
  983. };
  984.  
  985. #ifdef COMMENT
  986. CONST CHAR
  987. yl1r8[] = {  /* Latin-1 to Hewlett Packard Roman8 */
  988. /* This is HP's official translation, straight from iconv */
  989. /* It is NOT invertible. */
  990.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  991.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  992.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  993.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  994.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  995.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  996.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  997. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  998. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  999. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1000. 160, 184, 191, 187, 186, 188, 124, 189, 171,  99, 249, 251, 126,  45,  82, 176,
  1001. 179, 254,  50,  51, 168, 243, 244, 242,  44,  49, 250, 253, 247, 248, 245, 185,
  1002. 161, 224, 162, 225, 216, 208, 211, 180, 163, 220, 164, 165, 230, 229, 166, 167,
  1003. 227, 182, 232, 231, 223, 233, 218, 120, 210, 173, 237, 174, 219, 177, 240, 222,
  1004. 200, 196, 192, 226, 204, 212, 215, 181, 201, 197, 193, 205, 217, 213, 209, 221,
  1005. 228, 183, 202, 198, 194, 234, 206,  47, 214, 203, 199, 195, 207, 178, 241, 239
  1006. };
  1007. CONST CHAR
  1008. yr8l1[] = {  /* Hewlett Packard Roman8 to Latin-1 */
  1009. /* This is HP's official translation, straight from iconv */
  1010. /* It is NOT invertible. */
  1011.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1012.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1013.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1014.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1015.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1016.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1017.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1018. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1019. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1020. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1021. 160, 192, 194, 200, 202, 203, 206, 207, 180,  96,  94, 168, 126, 217, 219, 163,
  1022. 175, 221, 253, 176, 199, 231, 209, 241, 161, 191, 164, 163, 165, 167, 102, 162,
  1023. 226, 234, 244, 251, 225, 233, 243, 250, 224, 232, 242, 249, 228, 235, 246, 252,
  1024. 197, 238, 216, 198, 229, 237, 248, 230, 196, 236, 214, 220, 201, 239, 223, 212,
  1025. 193, 195, 227, 208, 240, 205, 204, 211, 210, 213, 245,  83, 115, 218,  89, 255,
  1026. 222, 254, 183, 181, 182, 190,  45, 188, 189, 170, 186, 171,  42, 187, 177, 160
  1027. };
  1028. #else /* !COMMENT */
  1029. /* This is an invertible mapping, approved by HP in January 1994. */
  1030. CONST CHAR
  1031. yl1r8[] = {  /* ISO Latin-1 to HP Roman8, Invertible */
  1032.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1033.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1034.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1035.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1036.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1037.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1038.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1039. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1040. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1041. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1042. 160, 184, 191, 187, 186, 188, 169, 189, 171, 170, 249, 251, 172, 175, 190, 176,
  1043. 179, 254, 235, 236, 168, 243, 244, 242, 238, 246, 250, 253, 247, 248, 245, 185,
  1044. 161, 224, 162, 225, 216, 208, 211, 180, 163, 220, 164, 165, 230, 229, 166, 167,
  1045. 227, 182, 232, 231, 223, 233, 218, 252, 210, 173, 237, 174, 219, 177, 240, 222,
  1046. 200, 196, 192, 226, 204, 212, 215, 181, 201, 197, 193, 205, 217, 213, 209, 221,
  1047. 228, 183, 202, 198, 194, 234, 206, 255, 214, 203, 199, 195, 207, 178, 241, 239
  1048. };
  1049.  
  1050. CONST CHAR
  1051. yr8l1[] = { /* HP Roman8 to ISO Latin-1, Invertible */
  1052.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1053.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1054.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1055.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1056.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1057.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1058.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1059. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1060. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1061. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1062. 160, 192, 194, 200, 202, 203, 206, 207, 180, 166, 169, 168, 172, 217, 219, 173,
  1063. 175, 221, 253, 176, 199, 231, 209, 241, 161, 191, 164, 163, 165, 167, 174, 162,
  1064. 226, 234, 244, 251, 225, 233, 243, 250, 224, 232, 242, 249, 228, 235, 246, 252,
  1065. 197, 238, 216, 198, 229, 237, 248, 230, 196, 236, 214, 220, 201, 239, 223, 212,
  1066. 193, 195, 227, 208, 240, 205, 204, 211, 210, 213, 245, 178, 179, 218, 184, 255,
  1067. 222, 254, 183, 181, 182, 190, 185, 188, 189, 170, 186, 171, 215, 187, 177, 247
  1068. };
  1069. #endif /* COMMENT */
  1070.  
  1071. CONST CHAR
  1072. yl143[] = {  /* Latin-1 to IBM Code Page 437 */
  1073. /*
  1074.   Although the IBM CDRA does not include an official translation between CP437
  1075.   and ISO Latin Alphabet 1, it does include an official, invertible
  1076.   translation between CP437 and CP850 (page 196), and another from CP850 to
  1077.   Latin-1 (CP819) (page 153).  This translation was obtained with a two-step
  1078.   process based on those tables.
  1079.   As of edit 183, the translation is modified to leave C0 controls alone.
  1080. */
  1081.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1082.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1083.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1084.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1085.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1086.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1087.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1088. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1089. 186, 205, 201, 187, 200, 188, 204, 185, 203, 202, 206, 223, 220, 219, 254, 242,
  1090. 179, 196, 218, 191, 192, 217, 195, 180, 194, 193, 197, 176, 177, 178, 213, 159,
  1091. 255, 173, 155, 156, 207, 157, 221, 245, 249, 184, 166, 174, 170, 240, 169, 238,
  1092. 248, 241, 253, 252, 239, 230, 244, 250, 247, 251, 167, 175, 172, 171, 243, 168,
  1093. 183, 181, 182, 199, 142, 143, 146, 128, 212, 144, 210, 211, 222, 214, 215, 216,
  1094. 209, 165, 227, 224, 226, 229, 153, 158, 190, 235, 233, 234, 154, 237, 232, 225,
  1095. 133, 160, 131, 198, 132, 134, 145, 135, 138, 130, 136, 137, 141, 161, 140, 139,
  1096. 208, 164, 149, 162, 147, 228, 148, 246, 189, 151, 163, 150, 129, 236, 231, 152
  1097. };
  1098.  
  1099. CONST CHAR
  1100. y43l1[] = {  /* IBM Code Page 437 to Latin-1 */
  1101. /*
  1102.   This table is the inverse of yl143[].
  1103. */
  1104.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1105.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1106.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1107.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1108.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1109.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1110.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1111. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1112. 199, 252, 233, 226, 228, 224, 229, 231, 234, 235, 232, 239, 238, 236, 196, 197,
  1113. 201, 230, 198, 244, 246, 242, 251, 249, 255, 214, 220, 162, 163, 165, 215, 159,
  1114. 225, 237, 243, 250, 241, 209, 170, 186, 191, 174, 172, 189, 188, 161, 171, 187,
  1115. 155, 156, 157, 144, 151, 193, 194, 192, 169, 135, 128, 131, 133, 248, 216, 147,
  1116. 148, 153, 152, 150, 145, 154, 227, 195, 132, 130, 137, 136, 134, 129, 138, 164,
  1117. 240, 208, 202, 203, 200, 158, 205, 206, 207, 149, 146, 141, 140, 166, 204, 139,
  1118. 211, 223, 212, 210, 245, 213, 181, 254, 222, 218, 219, 217, 253, 221, 175, 180,
  1119. 173, 177, 143, 190, 182, 167, 247, 184, 176, 168, 183, 185, 179, 178, 142, 160
  1120. };
  1121.  
  1122. CONST CHAR
  1123. yl1aq[] = {  /* Latin-1 to Extended Mac Latin (based on Apple QuickDraw) */
  1124.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1125.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1126.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1127.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1128.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1129.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1130.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1131. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1132. 182, 183, 184, 185, 189, 196, 197, 198, 206, 207, 210, 211, 217, 218, 195, 212,
  1133. 209, 215, 213, 226, 227, 228, 240, 245, 246, 247, 249, 250, 251, 253, 254, 255,
  1134. 202, 193, 162, 163, 219, 180, 201, 164, 172, 169, 187, 199, 194, 208, 168, 248,
  1135. 161, 177, 170, 173, 171, 181, 166, 225, 252, 176, 188, 200, 178, 179, 186, 192,
  1136. 203, 231, 229, 204, 128, 129, 174, 130, 233, 131, 230, 232, 237, 234, 235, 236,
  1137. 220, 132, 241, 238, 239, 205, 133, 165, 175, 244, 242, 243, 134, 160, 222, 167,
  1138. 136, 135, 137, 139, 138, 140, 190, 141, 143, 142, 144, 145, 147, 146, 148, 149,
  1139. 221, 150, 152, 151, 153, 155, 154, 214, 191, 157, 156, 158, 159, 224, 223, 216
  1140. };
  1141.  
  1142. CONST CHAR
  1143. yl1du[] = {  /* Latin-1 to Dutch ISO 646 */
  1144.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1145.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1146.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1147.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1148. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1149.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1150.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1151. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK,  39, 127,
  1152. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1153. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1154.  32,  33, UNK,  35, 124, UNK, UNK,  93, 123,  67, UNK,  34, UNK,  45,  82, UNK,
  1155.  91, UNK, UNK, UNK, 126, 117, UNK, UNK,  44, UNK, UNK,  34, 125,  92,  64,  63,
  1156.  65,  65,  65,  65,  91,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1157. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1158.  97,  97,  97,  97,  97,  97,  97,  99, 101, 101, 101, 101, 105, 105, 105, 105,
  1159. UNK, 110, 111, 111, 111, 111, 111,  47, 111, 117, 117, 117, 117, 121, UNK,  91
  1160. };
  1161.  
  1162. CONST CHAR
  1163. yl1fi[] = {  /* Latin-1 to Finnish ISO NRC (*not* ISO 646) */
  1164.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1165.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1166.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1167.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1168.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1169.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK,  95,
  1170. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1171. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1172. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1173. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1174.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1175. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1176.  65,  65,  65,  65,  91,  93,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1177. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  94,  89, UNK, 115,
  1178.  97,  97,  97,  97, 123, 125,  97,  99, 101,  96, 101, 101, 105, 105, 105, 105,
  1179. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 126, 121, UNK, 121
  1180. };
  1181.  
  1182. CONST CHAR
  1183. yl1fr[] = {  /* Latin-1 to French ISO 646 */
  1184.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1185.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1186.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1187.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1188. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1189.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1190.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1191. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1192. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1193. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1194.  32,  33, UNK,  35, UNK, UNK, UNK,  93,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1195.  91, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1196.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1197. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1198.  64,  97,  97,  97,  97,  97,  97,  92, 125, 123, 101, 101, 105, 105, 105, 105,
  1199. UNK, 110, 111, 111, 111, 111, 111,  47, 111, 124, 117, 117, 117, 121, UNK, 121
  1200. };
  1201.  
  1202. CONST CHAR
  1203. yl1fc[] = {  /* Latin-1 to French-Canadian ISO 646 */
  1204.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1205.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1206.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1207.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1208. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1209.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK,  95,
  1210. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1211. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1212. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1213. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1214.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1215. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1216.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1217. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1218.  64,  97,  91,  97,  97,  97,  97,  92, 125, 123,  93, 101, 105, 105,  94, 105,
  1219. UNK, 110, 111, 111,  96, 111, 111,  47, 111, 124, 117, 126, 117, 121, UNK, 121
  1220. };
  1221.  
  1222. CONST CHAR
  1223. yl1ge[] = {  /* Latin-1 to German ISO 646 */
  1224.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1225.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1226.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1227.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1228. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1229.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1230.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1231. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1232. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1233. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1234.  32,  33, UNK, UNK, UNK, UNK, UNK,  64,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1235. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1236.  65,  65,  65,  65,  91,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1237. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  93,  89, UNK, 126,
  1238.  97,  97,  97,  97, 123,  97,  97,  99, 101, 101, 101, 101, 105, 105, 105, 105,
  1239. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 125, 121, UNK, 121
  1240. };
  1241.  
  1242. CONST CHAR
  1243. yl1hu[] = {  /* Latin-1 to Hungarian ISO-646 */
  1244.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1245.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1246.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1247.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1248.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1249.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1250.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1251. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1252. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1253. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1254.  32,  33, UNK, UNK,  36, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1255. UNK,  64, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1256.  65,  65,  65,  65,  65,  65,  65,  67,  69,  91,  69,  69,  73,  73,  73,  73,
  1257. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  93,  89, UNK, 115,
  1258.  97,  96,  97,  97,  97,  97,  97,  99, 101, 123, 101, 101, 105, 105, 105, 105,
  1259. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 125, 121, UNK, 121
  1260. };
  1261.  
  1262. CONST CHAR
  1263. yl1it[] = {  /* Latin-1 to Italian ISO 646 */
  1264.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1265.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1266.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1267.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1268. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1269.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1270. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1271. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1272. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1273. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1274.  32,  33, UNK,  35, UNK, UNK, UNK,  64,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1275.  91, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1276.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1277. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1278. 123,  97,  97,  97,  97,  97,  97,  92, 125,  93, 101, 101, 126, 105, 105, 105,
  1279. UNK, 110, 124, 111, 111, 111, 111,  47, 111,  96, 117, 117, 117, 121, UNK, 121
  1280. };
  1281.  
  1282. CONST CHAR
  1283. yl1ne[] = {  /* Latin-1 to NeXT */
  1284. /* NEED TO MAKE THIS ONE INVERTIBLE, LIKE CP850 */
  1285. /*
  1286.   Which means finding all the graphic characters in the NeXT set that have
  1287.   no equivalent in Latin-1 and assigning them to the UNK positions (mostly
  1288.   Latin-1 C1 controls).  Then make the ynel1[] table be the inverse of this
  1289.   one.  But first we should try to get an official Latin-1/NeXT translation
  1290.   table from NeXT, Inc.
  1291. */
  1292.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1293.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1294.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1295.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1296.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1297.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1298.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1299. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1300. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1301. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1302.  32, 161, 162, 163, 168, 165, 181, 167, 200, 160, 227, 171, 190, UNK, 176, 197,
  1303. 202, 209, 201, 204, 194, 157, 182, 183, 203, 192, 235, 187, 210, 211, 212, 191,
  1304. 129, 130, 131, 132, 133, 134, 225, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1305. 144, 145, 146, 147, 148, 149, 150, 158, 233, 151, 152, 153, 154, 155, 156, 251,
  1306. 213, 214, 215, 216, 217, 218, 241, 219, 220, 221, 222, 223, 224, 226, 228, 229,
  1307. 230, 231, 236, 237, 238, 239, 240, 159, 249, 242, 243, 244, 246, 247, 252, 253
  1308. };
  1309.  
  1310. CONST CHAR
  1311. yl1no[] = {  /* Latin-1 to Norwegian/Danish ISO 646 */
  1312.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1313.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1314.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1315.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1316.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1317.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1318.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1319. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, 126, 127,
  1320. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1321. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1322.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1323. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1324.  65,  65,  65,  65,  65,  93,  91,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1325. UNK,  78,  79,  79,  79,  79,  79, 120,  92,  85,  85,  85,  85,  89, UNK, 115,
  1326.  97,  97,  97,  97,  97, 125, 123,  99, 101, 101, 101, 101, 105, 105, 105, 105,
  1327. UNK, 110, 111, 111, 111, 111, 111,  47, 124, 117, 117, 117, 117, 121, UNK, 121
  1328. };
  1329.  
  1330. CONST CHAR
  1331. yl1po[] = {  /* Latin-1 to Portuguese ISO 646 */
  1332.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1333.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1334.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1335.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1336.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1337.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1338.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1339. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, 126, 127,
  1340. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1341. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1342.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1343. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1344.  65,  65,  65,  91,  65,  65,  65,  92,  69,  69,  69,  69,  73,  73,  73,  73,
  1345. UNK,  78,  79,  79,  79,  93,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1346.  97,  97,  97, 123,  97,  97,  97, 124, 101, 101, 101, 101, 105, 105, 105, 105,
  1347. UNK, 110, 111, 111, 111, 125, 111,  47, 111, 117, 117, 117, 117, 121, UNK, 121
  1348. };
  1349.  
  1350. CONST CHAR
  1351. yl1sp[] = {  /* Latin-1 to Spanish ISO 646 */
  1352.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1353.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1354.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1355.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1356. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1357.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1358.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1359. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,  96, UNK, UNK, 126, 127,
  1360. 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1361. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1362.  32,  91, UNK,  35, UNK, UNK, UNK,  64,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1363. 123, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  93,
  1364.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1365. UNK,  92,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1366. 124,  97,  97,  97,  97,  97,  97, 125, 101, 101, 101, 101, 105, 105, 105, 105,
  1367. UNK, 124, 111, 111, 111, 111, 111,  47, 111, 117, 117, 117, 117, 121, UNK, 121
  1368. };
  1369.  
  1370. CONST CHAR
  1371. yl1sw[] = {  /* Latin-1 to Swedish ISO 646 */
  1372.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1373.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1374.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1375.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1376. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1377.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK,  95,
  1378. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1379. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1380. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1381. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1382.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1383. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1384.  65,  65,  65,  65,  91,  93,  65,  67,  69,  64,  69,  69,  73,  73,  73,  73,
  1385. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  94,  89, UNK, 115,
  1386.  97,  97,  97,  97, 123, 125,  97,  99, 101,  96, 101, 101, 105, 105, 105, 105,
  1387. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 126, 121, UNK, 121
  1388. };
  1389.  
  1390. CONST CHAR
  1391. yl1ch[] = {  /* Latin-1 to Swiss ISO 646 */
  1392.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1393.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1394.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1395.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1396. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1397.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK, UNK,
  1398.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1399. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1400. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1401. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1402.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1403. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1404.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1405. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1406.  64,  97,  97,  97, 123,  97,  97,  92,  95,  91,  93, 101, 105, 105,  94, 105,
  1407. UNK, 110, 111, 111,  96, 111, 124,  47, 111,  35, 117, 126, 125, 121, UNK, 121
  1408. };
  1409.  
  1410. CONST CHAR
  1411. yl1dm[] = {  /* Latin-1 to DEC Multinational Character Set */
  1412.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1413.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1414.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1415.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1416.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1417.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1418.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1419. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1420. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1421. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1422.  32, 161, 162, 163, 168, 165, 124, 167,  34, 169, 170, 171, 126, UNK,  82, UNK,
  1423. 176, 177, 178, 179,  39, 181, 182, 183,  44, 185, 186, 187, 188, 189, UNK, 191,
  1424. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1425. UNK, 209, 210, 211, 212, 213, 214, 120, 216, 217, 218, 219, 220, 221, UNK, 223,
  1426. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1427. UNK, 241, 242, 243, 244, 245, 246,  47, 248, 249, 250, 251, 252, UNK, UNK, 253
  1428. };
  1429.  
  1430. CONST CHAR
  1431. yl1dg[] = {  /* Latin-1 to Data General International Character Set */
  1432.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1433.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1434.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1435.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1436.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1437.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1438.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1439. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1440. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1441. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1442. 160, 171, 167, 168, 166, 181, 191, 187, 189, 173, 169, 177, 161, 255, 174, 175,
  1443. 188, 182, 164, 165, 190, 163, 178, 185, 186, 179, 170, 176, 223, 162, 220, 172,
  1444. 193, 192, 194, 196, 195, 197, 198, 199, 201, 200, 202, 203, 205, 204, 206, 207,
  1445. 184, 208, 210, 209, 211, 213, 212, 215, 214, 217, 216, 218, 219, 221, 222, 252,
  1446. 225, 224, 226, 228, 227, 229, 230, 231, 233, 232, 234, 235, 237, 236, 238, 239,
  1447. 183, 240, 242, 241, 243, 245, 244, 247, 246, 249, 248, 250, 251, 180, 254, 253
  1448. };
  1449.  
  1450.  
  1451. /* Local file character sets to ISO Latin Alphabet 1 */
  1452.  
  1453. #ifdef NOTUSED
  1454. CONST CHAR
  1455. yasl1[] = {  /* ASCII to Latin-1 */
  1456.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1457.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1458.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1459.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1460.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1461.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1462.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1463. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127
  1464. };
  1465. #endif /* NOTUSED */
  1466.  
  1467. CONST CHAR
  1468. yaql1[] = {  /* Extended Mac Latin (based on Apple Quickdraw) to Latin-1 */
  1469.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1470.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1471.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1472.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1473.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1474.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1475.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1476. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1477. 196, 197, 199, 201, 209, 214, 220, 225, 224, 226, 228, 227, 229, 231, 233, 232,
  1478. 234, 235, 237, 236, 238, 239, 241, 243, 242, 244, 246, 245, 250, 249, 251, 252,
  1479. 221, 176, 162, 163, 167, 215, 182, 223, 174, 169, 178, 180, 168, 179, 198, 216,
  1480. 185, 177, 188, 189, 165, 181, 128, 129, 130, 131, 190, 170, 186, 132, 230, 248,
  1481. 191, 161, 172, 142, 133, 134, 135, 171, 187, 166, 160, 192, 195, 213, 136, 137,
  1482. 173, 144, 138, 139, 143, 146, 247, 145, 255, 140, 141, 164, 208, 240, 222, 254,
  1483. 253, 183, 147, 148, 149, 194, 202, 193, 203, 200, 205, 206, 207, 204, 211, 212,
  1484. 150, 210, 218, 219, 217, 151, 152, 153, 175, 154, 155, 156, 184, 157, 158, 159
  1485. };
  1486.  
  1487. CONST CHAR
  1488. ydul1[] = {  /* Dutch ISO 646 to Latin-1 */
  1489.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1490.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1491.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1492.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1493. 190,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1494.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 255, 189, 124,  94,  95,
  1495.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1496. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 168, 164, 188,  39, 127
  1497. };
  1498.  
  1499. CONST CHAR
  1500. yfil1[] = {  /* Finnish NRC (*not* ISO-646) to Latin-1 */
  1501.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1502.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1503.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1504.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1505.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1506.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 196, 214, 197, 220,  95,
  1507. 233,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1508. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 229, 252, 127
  1509. };
  1510.  
  1511. CONST CHAR
  1512. yfrl1[] = {  /* French ISO 646 to Latin-1 */
  1513.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1514.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1515.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1516.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1517. 224,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1518.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 176, 231, 167,  94,  95,
  1519.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1520. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 249, 232, 168, 127
  1521. };
  1522.  
  1523. CONST CHAR
  1524. yfcl1[] = {  /* French-Canadian ISO 646 to Latin-1 */
  1525.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1526.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1527.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1528.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1529. 224,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1530.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 226, 231, 234, 238,  95,
  1531. 244,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1532. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 249, 232, 251, 127
  1533. };
  1534.  
  1535. CONST CHAR
  1536. ygel1[] = {  /* German ISO 646 to Latin-1 */
  1537.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1538.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1539.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1540.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1541. 167,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1542.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 196, 214, 220,  94,  95,
  1543.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1544. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 252, 223, 127
  1545. };
  1546.  
  1547. CONST CHAR
  1548. yitl1[] = {  /* Italian ISO 646 to Latin-1 */
  1549.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1550.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1551.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1552.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1553. 167,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1554.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 176, 231, 233,  94,  95,
  1555. 249,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1556. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 224, 242, 232, 236, 127
  1557. };
  1558.  
  1559. CONST CHAR
  1560. ynel1[] = {  /* NeXT to Latin-1 */
  1561. /* NEED TO MAKE THIS ONE INVERTIBLE */
  1562.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1563.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1564.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1565.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1566.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1567.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1568.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1569. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1570. 160, 192, 193, 194, 195, 196, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1571. 208, 209, 210, 211, 212, 213, 214, 217, 218, 219, 220, 221, 222, 181, 215, 247,
  1572. 169, 161, 162, 163, UNK, 165, UNK, 167, 164, UNK, UNK, 171, UNK, UNK, UNK, UNK,
  1573. 174, UNK, UNK, UNK, 183, 166, 182, UNK, UNK, UNK, UNK, 187, UNK, UNK, 172, 191,
  1574. 185,  96, 180,  94, 126, 175, UNK, UNK, 168, 178, 176, 184, 179, UNK, UNK, UNK,
  1575. UNK, 177, 188, 189, 190, 224, 225, 226, 227, 228, 229, 231, 232, 233, 234, 235,
  1576. 236, 198, 237, 170, 238, 239, 240, 241, UNK, 216, UNK, 186, 242, 243, 244, 245,
  1577. 246, 230, 249, 250, 251, UNK, 252, 253, UNK, 248, UNK, 223, 254, 255, UNK, UNK
  1578. };
  1579.  
  1580. CONST CHAR
  1581. ynol1[] = {  /* Norwegian/Danish ISO 646 to Latin-1 */
  1582.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1583.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1584.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1585.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1586.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1587.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 198, 216, 197,  94,  95,
  1588.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1589. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 230, 248, 229, 126, 127
  1590. };
  1591.  
  1592. CONST CHAR
  1593. ypol1[] = {  /* Portuguese ISO 646 to Latin-1 */
  1594.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1595.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1596.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1597.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1598.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1599.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 195, 199, 213,  94,  95,
  1600.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1601. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 227, 231, 245, 126, 127
  1602. };
  1603.  
  1604. CONST CHAR
  1605. yspl1[] = {  /* Spanish ISO 646 to Latin-1 */
  1606.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1607.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1608.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1609.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1610. 167,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1611.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 161, 209, 191,  94,  95,
  1612.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1613. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 176, 241, 231, 126, 127
  1614. };
  1615.  
  1616. CONST CHAR
  1617. yswl1[] = {  /* Swedish ISO 646 to Latin-1 */
  1618.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1619.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1620.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1621.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1622. 201,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1623.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 196, 214, 197, 220,  95,
  1624. 233,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1625. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 229, 252, 127
  1626. };
  1627.  
  1628. CONST CHAR
  1629. ychl1[] = {  /* Swiss ISO 646 to Latin-1 */
  1630.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1631.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1632.  32,  33,  34, 249,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1633.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1634. 224,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1635.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 233, 231, 234, 238, 232,
  1636. 244,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1637. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 252, 251, 127
  1638. };
  1639.  
  1640. CONST CHAR
  1641. yhul1[] = {  /* Hungarian ISO 646 to Latin-1 */
  1642.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1643.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1644.  32,  33,  34,  35, 164,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1645.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1646. 193,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1647.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 201, 214, 220,  94,  95,
  1648. 225,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1649. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 246, 252,  34, 127
  1650. };
  1651.  
  1652. CONST CHAR
  1653. ydml1[] = {  /* DEC Multinational Character Set to Latin-1 */
  1654. /* Note: This is a null translation */
  1655.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1656.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1657.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1658.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1659.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1660.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1661.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1662. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1663. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1664. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1665. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1666. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1667. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1668. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1669. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1670. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
  1671. };
  1672.  
  1673. CONST CHAR
  1674. ydgl1[] = {  /* Data General International to Latin-1 */
  1675.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1676.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1677.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1678.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1679.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1680.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1681.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1682. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1683. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1684. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1685. 160, 172, 189, 181, 178, 179, 164, 162, 163, 170, 186, 161, 191, 169, 174, 175,
  1686. 187, 171, 182, 185, 253, 165, 177, 240, 208, 183, 184, 167, 176, 168, 180, 166,
  1687. 193, 192, 194, 196, 195, 197, 198, 199, 201, 200, 202, 203, 205, 204, 206, 207,
  1688. 209, 211, 210, 212, 214, 213, 216, 215, 218, 217, 219, 220, 190, 221, 222, 188,
  1689. 225, 224, 226, 228, 227, 229, 230, 231, 233, 232, 234, 235, 237, 236, 238, 239,
  1690. 241, 243, 242, 244, 246, 245, 248, 247, 250, 249, 251, 252, 223, 255, 254, 173
  1691. };
  1692.  
  1693.  
  1694. /* Translation tables for Cyrillic character sets */
  1695.  
  1696. #ifdef CYRILLIC
  1697. CONST CHAR
  1698. ylcac[] = {  /* Latin/Cyrillic to CP866 */
  1699.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1700.  16,  17,  18,  19, 208, 209,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1701.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1702.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1703.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1704.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1705.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1706. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1707. 196, 179, 192, 217, 191, 218, 195, 193, 180, 194, 197, 176, 177, 178, 211, 216,
  1708. 205, 186, 200, 188, 187, 201, 204, 202, 185, 203, 206, 223, 220, 219, 254, UNK,
  1709. 255, 240, 132, 131, 242,  83,  73, 244,  74, 139, 141, 151, 138,  45, 246, 135,
  1710. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1711. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1712. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1713. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1714. 252, 241, 164, 163, 243, 115, 105, 245, 106, 171, 173, 231, 170,  21, 247, 167
  1715. };
  1716.  
  1717. CONST CHAR
  1718. ylc55[] = {  /* Latin/Cyrillic to CP855 (inverse of y55lc) */
  1719.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1720.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1721.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1722.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1723.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1724.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1725.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1726. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1727. 174, 175, 176, 177, 178, 179, 180, 185, 186, 187, 188, 191, 192, 193, 194, 195,
  1728. 196, 197, 200, 201, 202, 203, 204, 205, 206, 207, 217, 218, 219, 220, 223, 254,
  1729. 255, 133, 129, 131, 135, 137, 139, 141, 143, 145, 147, 149, 151, 240, 153, 155,
  1730. 161, 163, 236, 173, 167, 169, 234, 244, 184, 190, 199, 209, 211, 213, 215, 221,
  1731. 226, 228, 230, 232, 171, 182, 165, 252, 246, 250, 159, 242, 238, 248, 157, 224,
  1732. 160, 162, 235, 172, 166, 168, 233, 243, 183, 189, 198, 208, 210, 212, 214, 216,
  1733. 225, 227, 229, 231, 170, 181, 164, 251, 245, 249, 158, 241, 237, 247, 156, 222,
  1734. 239, 132, 128, 130, 134, 136, 138, 140, 142, 144, 146, 148, 150, 253, 152, 154
  1735. };
  1736.  
  1737. CONST CHAR
  1738. ylc1251[] = {  /* Latin/Cyrillic to CP1251 (inverse of y1251lc) */
  1739.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1740.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1741.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1742.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1743.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1744.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1745.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1746. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1747. 130, 132, 133, 134, 135, 136, 137, 139, 145, 146, 147, 148, 149, 150, 151, 152,
  1748. 153, 155, 164, 165, 166, 169, 171, 172, 174, 176, 177, 180, 181, 182, 183, 187,
  1749. 160, 168, 128, 129, 170, 189, 178, 175, 163, 138, 140, 142, 141, 173, 161, 143,
  1750. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1751. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1752. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1753. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
  1754. 185, 184, 144, 131, 186, 190, 179, 191, 188, 154, 156, 158, 157, 167, 162, 159
  1755. };
  1756.  
  1757. CONST CHAR
  1758. ylcbu[] = {  /* Latin/Cyrillic to Bulgarian PC Code Page */
  1759.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1760.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1761.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1762.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1763.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1764.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1765.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1766. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1767. 255, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
  1768. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1769. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1770. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1771. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1772. 213, 207, 208, 209, 210, 211, 212, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1773. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1774. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 214, 253, 254
  1775. };
  1776.  
  1777. CONST CHAR
  1778. ylck8[] = {  /* Latin/Cyrillic to Old KOI-8 Cyrillic */
  1779.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1780.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1781.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1782.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1783.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1784.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1785.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1786. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1787. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1788. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1789. UNK, 229, UNK, UNK, UNK,  83,  73,  73,  74, UNK, UNK, UNK, 235, UNK, 245, UNK,
  1790. 225, 226, 247, 231, 228, 229, 246, 250, 233, 234, 235, 236, 237, 238, 239, 240,
  1791. 242, 243, 244, 245, 230, 232, 227, 254, 251, 253, 255, 249, 248, 252, 224, 241,
  1792. 193, 194, 215, 199, 196, 197, 214, 218, 201, 202, 203, 204, 205, 206, 207, 208,
  1793. 210, 211, 212, 213, 198, 200, 195, 222, 219, 221, 223, 217, 216, 220, 192, 209,
  1794. UNK, 197, UNK, UNK, UNK, 115, 105, 105, 106, UNK, UNK, UNK, 203, UNK, 213, UNK
  1795. };
  1796.  
  1797. CONST CHAR
  1798. yaclc[] = {  /* CP866 to Latin/Cyrillic */
  1799. /* NEED TO MAKE THIS ONE INVERTIBLE */
  1800.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1801.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1802.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1803.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1804.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1805.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1806.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1807. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1808. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1809. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1810. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1811. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1812. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1813. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1814. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1815. 161, 241, 164, 244, 167, 247, 174, 254, UNK, UNK, UNK, UNK, 240, UNK, UNK, UNK
  1816. };
  1817.  
  1818. CONST CHAR
  1819. y55lc[] = {  /* CP855 to Latin/Cyrillic (inverse of ylc55) */
  1820.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1821.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1822.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1823.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1824.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1825.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1826.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1827. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1828. 242, 162, 243, 163, 241, 161, 244, 164, 245, 165, 246, 166, 247, 167, 248, 168,
  1829. 249, 169, 250, 170, 251, 171, 252, 172, 254, 174, 255, 175, 238, 206, 234, 202,
  1830. 208, 176, 209, 177, 230, 198, 212, 180, 213, 181, 228, 196, 211, 179, 128, 129,
  1831. 130, 131, 132, 133, 134, 229, 197, 216, 184, 135, 136, 137, 138, 217, 185, 139,
  1832. 140, 141, 142, 143, 144, 145, 218, 186, 146, 147, 148, 149, 150, 151, 152, 153,
  1833. 219, 187, 220, 188, 221, 189, 222, 190, 223, 154, 155, 156, 157, 191, 239, 158,
  1834. 207, 224, 192, 225, 193, 226, 194, 227, 195, 214, 182, 210, 178, 236, 204, 240,
  1835. 173, 235, 203, 215, 183, 232, 200, 237, 205, 233, 201, 231, 199, 253, 159, 160
  1836. };
  1837.  
  1838. CONST CHAR
  1839. y1251lc[] = {  /* CP1251 to Latin/Cyrillic (inverse of ylc1251) */
  1840.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1841.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1842.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1843.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1844.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1845.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1846.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1847. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1848. 162, 163, 128, 243, 129, 130, 131, 132, 133, 134, 169, 135, 170, 172, 171, 175,
  1849. 242, 136, 137, 138, 139, 140, 141, 142, 143, 144, 249, 145, 250, 252, 251, 255,
  1850. 160, 174, 254, 168, 146, 147, 148, 253, 161, 149, 164, 150, 151, 173, 152, 167,
  1851. 153, 154, 166, 246, 155, 156, 157, 158, 241, 240, 244, 159, 248, 165, 245, 247,
  1852. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1853. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1854. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1855. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239
  1856. };
  1857.  
  1858. CONST CHAR
  1859. ybulc[] = {  /* Bulgarian PC Code Page to Latin/Cyrillic */
  1860.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1861.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1862.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1863.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1864.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1865.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1866.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1867. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1868. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1869. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1870. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1871. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1872. 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 209,
  1873. 210, 211, 212, 213, 214, 208, 253, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1874. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1875. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 254, 255, 128
  1876. };
  1877.  
  1878. CONST CHAR
  1879. yk8lc[] = {  /* Old KOI-8 Cyrillic to Latin/Cyrillic */
  1880.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1881.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1882.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1883.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1884.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1885.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1886.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1887. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1888. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1889. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1890. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1891. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1892. 238, 208, 209, 230, 212, 213, 228, 211, 229, 216, 217, 218, 219, 220, 221, 222,
  1893. 223, 239, 224, 225, 226, 227, 214, 210, 236, 235, 215, 232, 237, 233, 231, 234,
  1894. 206, 176, 177, 198, 180, 181, 196, 179, 197, 184, 185, 186, 187, 188, 189, 190,
  1895. 191, 207, 192, 193, 194, 195, 182, 178, 204, 203, 183, 200, 205, 201, 199, 127
  1896. };
  1897.  
  1898. CONST CHAR
  1899. ylcsk[] = {  /* Latin/Cyrillic to Short KOI */
  1900.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1901.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1902.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1903.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1904.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1905.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1906.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1907.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94, 127,
  1908.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1909.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1910.  32, 101, UNK, UNK, UNK,  83,  73,  73,  74, UNK, UNK, UNK, 107,  45, 117, UNK,
  1911.  97,  98, 119, 103, 100, 101, 118, 122, 105, 106, 107, 108, 109, 110, 111, 112,
  1912. 114, 115, 116, 117, 102, 104,  99, 126, 123, 125,  39, 121, 120, 124,  96, 113,
  1913.  97,  98, 119, 103, 100, 101, 118, 122, 105, 106, 107, 108, 109, 110, 111, 112,
  1914. 114, 115, 116, 117, 102, 104,  99, 126, 123, 125,  39, 121, 120, 124,  96, 113,
  1915. UNK, 101, UNK, UNK, UNK,  83,  73,  73,  74, UNK, UNK, UNK, 107, UNK, 117, UNK
  1916. };
  1917.  
  1918. CONST CHAR yskcy[] = {  /* Short KOI to Latin/Cyrillic */
  1919.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1920.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1921.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1922.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1923.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1924.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1925. 206, 176, 177, 198, 180, 181, 196, 179, 197, 184, 185, 186, 187, 188, 189, 190,
  1926. 191, 207, 192, 193, 194, 195, 182, 178, 204, 203, 183, 200, 205, 201, 199, 127
  1927. };
  1928. #endif /* CYRILLIC */
  1929.  
  1930. #ifdef LATIN2
  1931.  
  1932. /* Latin-2 tables */
  1933.  
  1934. CONST CHAR
  1935. yl252[] = {                /* Latin-2 to Code Page 852 */
  1936.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1937.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1938.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1939.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1940.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1941.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1942.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1943. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1944. 174, 175, 176, 177, 178, 179, 180, 185, 186, 187, 188, 191, 192, 193, 194, 195,
  1945. 196, 197, 200, 201, 202, 203, 204, 205, 206, 217, 218, 219, 220, 223, 240, 254,
  1946. 255, 164, 244, 157, 207, 149, 151, 245, 249, 230, 184, 155, 141, 170, 166, 189,
  1947. 248, 165, 242, 136, 239, 150, 152, 243, 247, 231, 173, 156, 171, 241, 167, 190,
  1948. 232, 181, 182, 198, 142, 145, 143, 128, 172, 144, 168, 211, 183, 214, 215, 210,
  1949. 209, 227, 213, 224, 226, 138, 153, 158, 252, 222, 233, 235, 154, 237, 221, 225,
  1950. 234, 160, 131, 199, 132, 146, 134, 135, 159, 130, 169, 137, 216, 161, 140, 212,
  1951. 208, 228, 229, 162, 147, 139, 148, 246, 253, 133, 163, 251, 129, 236, 238, 250
  1952. };
  1953.  
  1954. CONST CHAR
  1955. y52l2[] = {                /* Code Page 852 to Latin-2 */
  1956.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1957.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1958.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1959.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1960.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1961.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1962.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1963. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1964. 199, 252, 233, 226, 228, 249, 230, 231, 179, 235, 213, 245, 238, 172, 196, 198,
  1965. 201, 197, 229, 244, 246, 165, 181, 166, 182, 214, 220, 171, 187, 163, 215, 232,
  1966. 225, 237, 243, 250, 161, 177, 174, 190, 202, 234, 173, 188, 200, 186, 128, 129,
  1967. 130, 131, 132, 133, 134, 193, 194, 204, 170, 135, 136, 137, 138, 175, 191, 139,
  1968. 140, 141, 142, 143, 144, 145, 195, 227, 146, 147, 148, 149, 150, 151, 152, 164,
  1969. 240, 208, 207, 203, 239, 210, 205, 206, 236, 153, 154, 155, 156, 222, 217, 157,
  1970. 211, 223, 212, 209, 241, 242, 169, 185, 192, 218, 224, 219, 253, 221, 254, 180,
  1971. 158, 189, 178, 183, 162, 167, 247, 184, 176, 168, 255, 251, 216, 248, 159, 160
  1972. };
  1973.  
  1974. CONST CHAR
  1975. yl21250[] = {                /* Latin-2 to Code Page 1250 */
  1976.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1977.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1978.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1979.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1980.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1981.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1982.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1983. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1984. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 139, 144, 145, 146, 147, 148,
  1985. 149, 150, 151, 152, 153, 155, 166, 169, 171, 172, 174, 177, 181, 182, 183, 187,
  1986. 160, 165, 162, 163, 164, 188, 140, 167, 168, 138, 170, 141, 143, 173, 142, 175,
  1987. 176, 185, 178, 179, 180, 190, 156, 161, 184, 154, 186, 157, 159, 189, 158, 191,
  1988. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1989. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1990. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1991. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
  1992. };
  1993.  
  1994. CONST CHAR
  1995. y1250l2[] = {                /* Code Page 1250 to Latin-2 */
  1996.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1997.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1998.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1999.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2000.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2001.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2002.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2003. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2004. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 169, 138, 166, 171, 174, 172,
  2005. 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 185, 149, 182, 187, 190, 188,
  2006. 160, 183, 162, 163, 164, 161, 150, 167, 168, 151, 170, 152, 153, 173, 154, 175,
  2007. 176, 155, 178, 179, 180, 156, 157, 158, 184, 177, 186, 159, 165, 189, 181, 191,
  2008. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  2009. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  2010. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  2011. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
  2012. };
  2013.  
  2014. CONST CHAR
  2015. yl2mz[] = {                 /* Latin-2 to Mazovia (NOT invertible) */
  2016.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2017.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2018.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2019.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2020.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2021.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2022.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2023. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2024. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  2025. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  2026. 255, 143, UNK, 156, 155,  76, 152,  21,  34,  83,  83,  84, 160,  45,  90, 161,
  2027. 248, 134,  44, 146,  39, 108, 158, UNK,  44, 115, 115, 116, 166,  34, 122, 167,
  2028.  82,  65,  65,  65, 142,  76, 149, 128,  67,  69, 144,  69,  69,  73,  73,  68,
  2029.  68, 165,  78, 163,  79, 153, 153, 250,  82,  85,  85, 154, 154,  89,  84, 225,
  2030. 114,  97, 131,  97, 132, 108, 141, 135,  99, 130, 145, 137, 101, 105, 140, 101,
  2031. 100, 164, 110, 162, 147, 148, 148, 246, 114, 117, 117, 129, 129, 121, 116, 249
  2032. };
  2033.  
  2034. CONST CHAR
  2035. ymzl2[] = {                 /* Mazovia to Latin-2 (NOT INVERTIBLE) */
  2036.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2037.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2038.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2039.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2040.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2041.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2042.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2043. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2044. 128, 252, 233, 226, 228,  97, 177, 231, 101, 235, 101, 105, 238, 230, 196, 161,
  2045. 202, 234, 179, 244, 246, 198, 117, 117, 166, 214, 220, 164, 163,  89, 182, 102,
  2046. 172, 175, 243, 211, 242, 210, 188, 191,  63, UNK, UNK, UNK, UNK,  33,  34,  34,
  2047. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2048. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2049. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2050. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2051. UNK, UNK, UNK, UNK, UNK, UNK, 247, UNK, 176, 255, 215, UNK, UNK, UNK, UNK, 160
  2052. };
  2053.  
  2054. CONST CHAR
  2055. yl2l1[] = {                /* Latin-2 to Latin-1 */
  2056.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2057.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2058.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2059.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2060.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2061.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2062.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2063. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2064. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  2065. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  2066. 160, 'A', UNK, 'L', 164, 'L', 'S', 167, 168, 'S', 'S', 'T', 'Z', 173, 'Z', 'Z',
  2067. 176, 'a', UNK, 'l', 180, 'l', 's', UNK, 184, 's', 's', 't', 'z', UNK, 'z', 'z',
  2068. 'R', 193, 194, 'A', 196, 'L', 'C', 199, 'C', 201, 'E', 203, 'E', 205, 'I', 'D',
  2069. 208, 'N', 'N', 211, 212, 'O', 214, 215, 'R', 'U', 218, 'U', 220, 221, 'T', 223,
  2070. 'r', 225, 226, 'a', 228, 'l', 'c', 231, 'c', 233, 'e', 235, 'e', 237, 'i', 'd',
  2071. 240, 'n', 'n', 243, 244, 'o', 246, 247, 'r', 'u', 250, 'u', 252, 253, 't', '.'
  2072. };
  2073.  
  2074. CONST CHAR
  2075. yl1l2[] = {                /* Latin-1 to Latin-2 */
  2076.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2077.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2078.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2079.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2080.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2081.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2082.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2083. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2084. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  2085. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  2086. 160, 'A', UNK, 'L', 164, UNK, UNK, 167, 168, 'C', 'a', '<', '>', 173, 'R', UNK,
  2087. 176, UNK, UNK, UNK, 180, UNK, UNK, UNK, 184, UNK, 'o', '>', UNK, UNK, UNK, UNK,
  2088. 'A', 193, 194, 'A', 196, 'A', 'A', 199, 'E', 201, 'E', 203, 'I', 205, 'I', 'I',
  2089. 208, 'N', 'O', 211, 212, 'O', 214, 215, 'O', 'U', 218, 'U', 220, 221, UNK, 223,
  2090. 'a', 225, 226, 'a', 228, 'a', 'a', 231, 'e', 233, 'e', 235, 'i', 237, 'i', 'i',
  2091. 240, 'n', 'o', 243, 244, 'o', 246, 247, 'o', 'u', 250, 'u', 252, 253, UNK, 'y'
  2092. };
  2093.  
  2094. CONST CHAR
  2095. yl2as[] = {                /* Latin-2 to ASCII */
  2096.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2097.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2098.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2099.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2100.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2101.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2102.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2103. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2104. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2105. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2106.  32, 'A', UNK, 'L', UNK, 'L', 'S', UNK,  34, 'S', 'S', 'T', 'Z', '-', 'Z', 'Z',
  2107. UNK, 'a', UNK, 'l',  39, 'l', 's', UNK,  44, 's', 's', 't', 'z', UNK, 'z', 'z',
  2108. 'R', 'A', 'A', 'A', 'A', 'L', 'C', 'C', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'D',
  2109. 'D', 'N', 'N', 'O', 'O', 'O', 'O', 'x', 'R', 'U', 'U', 'U', 'U', 'Y', 'T', 's',
  2110. 'r', 'a', 'a', 'a', 'a', 'l', 'c', 'c', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'd',
  2111. 'd', 'n', 'n', 'o', 'o', 'o', 'o', '/', 'r', 'u', 'u', 'u', 'u', 'y', 't', '.'
  2112. };
  2113. #endif /* LATIN2 */
  2114.  
  2115. #ifdef HEBREW
  2116. /*
  2117.   8-bit Tables providing invertible translation between Latin/Hebrew and CP862.
  2118. */
  2119. CONST CHAR
  2120. y62lh[] = {  /* PC Code Page 862 to ISO 8859-8 Latin/Hebrew */
  2121.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2122.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2123.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2124.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2125.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2126.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2127.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2128. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2129. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  2130. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 162, 163, 165, 128, 129,
  2131. 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 172, 189, 188, 140, 171, 187,
  2132. 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
  2133. 157, 158, 159, 161, 164, 166, 167, 168, 169, 170, 173, 174, 175, 223, 179, 180,
  2134. 182, 184, 185, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
  2135. 203, 204, 205, 206, 207, 208, 181, 209, 210, 211, 212, 213, 214, 215, 216, 217,
  2136. 218, 177, 219, 220, 221, 222, 186, 251, 176, 183, 252, 253, 254, 178, 255, 160
  2137. };
  2138.  
  2139. CONST CHAR
  2140. ylh62[] = {  /* ISO 8859-8 Latin/Hebrew to PC Code Page 862 */
  2141.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2142.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2143.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2144.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2145.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2146.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2147.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2148. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2149. 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 173, 176, 177, 178,
  2150. 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
  2151. 255, 195, 155, 156, 196, 157, 197, 198, 199, 200, 201, 174, 170, 202, 203, 204,
  2152. 248, 241, 253, 206, 207, 230, 208, 249, 209, 210, 246, 175, 172, 171, 211, 212,
  2153. 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
  2154. 229, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 242, 243, 244, 245, 205,
  2155. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  2156. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 247, 250, 251, 252, 254
  2157. };
  2158. /*
  2159.   7-bit table providing readable translation from DEC Hebrew-7 to CP862.
  2160. */
  2161. CONST CHAR
  2162. yh762[] = {
  2163.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2164.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2165.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2166.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2167.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2168.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2169. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2170.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 123, 124, 125, 126, 127
  2171. };
  2172. /*
  2173.   8-bit table providing readable translation from CP862 to Hebrew-7.
  2174. */
  2175. CONST CHAR
  2176. y62h7[] = {  /* PC Code Page 862 to Hebrew-7 */
  2177.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2178.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2179.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2180.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2181.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2182.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2183.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2184.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 123, 124, 125, 126, 127,
  2185.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2186. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, UNK,
  2187. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2188. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2189. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2190. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2191. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2192. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK
  2193. };
  2194. /*
  2195.   7-bit table providing readable translation from Hebrew-7 to ISO Latin/Hebrew.
  2196. */
  2197. CONST CHAR
  2198. yh7lh[] = {
  2199.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2200.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2201.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2202.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2203.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2204.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2205. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  2206. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 123, 124, 125, 126, 127
  2207. };
  2208. /*
  2209.   8-bit table providing readable translation from ISO Latin/Hebrew to Hebrew-7.
  2210. */
  2211. CONST CHAR
  2212. ylhh7[] = {  /* Latin/Hebrew to Hebrew-7 */
  2213.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2214.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2215.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2216.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2217.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2218.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2219.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2220.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 123, 124, 125, 126, 127,
  2221. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2222. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2223. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2224. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2225. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2226. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2227.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2228. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, UNK
  2229. };
  2230. #endif /* HEBREW */
  2231.  
  2232. #ifdef GREEK
  2233. /*
  2234.   8-bit Tables providing invertible translation between Latin/Greek and CP869.
  2235. */
  2236. CONST CHAR
  2237. ylg69[] = {  /* ISO 8859-7 Latin/Greek to PC Code Page 869 */
  2238.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2239.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2240.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2241.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2242.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2243.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2244.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2245. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2246. 135, 147, 148, 176, 177, 178, 179, 180, 185, 186, 187, 188, 191, 192, 193, 194,
  2247. 195, 196, 197, 200, 201, 202, 203, 204, 205, 206, 217, 218, 219, 220, 223, 254,
  2248. 255, 139, 140, 156, 128, 129, 138, 245, 249, 151, 130, 174, 137, 240, 131, 142,
  2249. 248, 241, 153, 154, 239, 247, 134, 136, 141, 143, 144, 175, 146, 171, 149, 152,
  2250. 161, 164, 165, 166, 167, 168, 169, 170, 172, 173, 181, 182, 183, 184, 189, 190,
  2251. 198, 199, 132, 207, 208, 209, 210, 211, 212, 213, 145, 150, 155, 157, 158, 159,
  2252. 252, 214, 215, 216, 221, 222, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
  2253. 234, 235, 237, 236, 238, 242, 243, 244, 246, 250, 160, 251, 162, 163, 253, 133
  2254. };
  2255.  
  2256. CONST CHAR
  2257. y69lg[] = {  /* PC Code Page 869 to ISO 8859-7 Latin/Greek */
  2258.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2259.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2260.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2261.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2262.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2263.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2264.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2265. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2266. 164, 165, 170, 174, 210, 255, 182, 128, 183, 172, 166, 161, 162, 184, 175, 185,
  2267. 186, 218, 188, 129, 130, 190, 219, 169, 191, 178, 179, 220, 163, 221, 222, 223,
  2268. 250, 192, 252, 253, 193, 194, 195, 196, 197, 198, 199, 189, 200, 201, 171, 187,
  2269. 131, 132, 133, 134, 135, 202, 203, 204, 205, 136, 137, 138, 139, 206, 207, 140,
  2270. 141, 142, 143, 144, 145, 146, 208, 209, 147, 148, 149, 150, 151, 152, 153, 211,
  2271. 212, 213, 214, 215, 216, 217, 225, 226, 227, 154, 155, 156, 157, 228, 229, 158,
  2272. 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 243, 242, 244, 180,
  2273. 173, 177, 245, 246, 247, 167, 248, 181, 176, 168, 249, 251, 224, 254, 159, 160
  2274. };
  2275. /*
  2276.   7-bit table providing readable translation from ELOT 927 to CP869.
  2277. */
  2278. CONST CHAR
  2279. yeg69[] = {
  2280.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2281.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2282.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2283.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2284.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2285.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2286.  96, 164, 165, 166, 167, 168, 169, 170, 172, 173, 181, 182, 183, 184, 189, 190,
  2287. 198, 199, 207, 208, 209, 210, 211, 212, 213,  32,  32,  23, 124, 125, 126, 127
  2288. };
  2289. /*
  2290.   8-bit table providing readable translation from CP869 to ELOT 927.
  2291. */
  2292. CONST CHAR
  2293. y69eg[] = {  /* PC Code Page 869 to ELOT 927 */
  2294.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2295.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2296.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2297.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2298.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2299.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2300.  96,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2301.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 123, 124, 125, 126, 127,
  2302. UNK, UNK, UNK, UNK, UNK, UNK,  97, UNK,  46, UNK, 124,  39,  39, 101,  45, 103,
  2303. 105, 105, 111, UNK, UNK, 116, 116, UNK, 120,  50,  51,  97, UNK, 101, 103, 105,
  2304. 105, 105, 111, 116,  97,  98,  99, 100, 101, 102, 103, UNK, 104, 105,  34,  34,
  2305. UNK, UNK, UNK, UNK, UNK, 106, 107, 108, 109, UNK, UNK, UNK, UNK, 110, 111, UNK,
  2306. UNK, UNK, UNK, UNK, UNK, UNK, 112, 113, UNK, UNK, UNK, UNK, UNK, UNK, UNK, 114,
  2307. 115, 116, 117, 118, 119, 120,  97,  98,  99, UNK, UNK, UNK, UNK, 100, 101, UNK,
  2308. 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115,  39,
  2309.  45, UNK, 116, 117, 118, UNK, 119, UNK, UNK, UNK, 120, 116, 116, 120, UNK,  32
  2310.  
  2311. };
  2312. /*
  2313.   7-bit table providing readable translation from ELOT 927 to ISO Latin/Greek.
  2314. */
  2315. CONST CHAR
  2316. yeglg[] = {
  2317.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2318.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2319.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2320.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2321.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2322.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2323.  96, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  2324. 208, 209, 211, 212, 213, 214, 215, 216, 217,  32,  32, 123, 124, 125, 126, 127
  2325. };
  2326. /*
  2327.   8-bit table providing readable translation from ISO Latin/Greek to ELOT 927.
  2328. */
  2329. CONST CHAR
  2330. ylgeg[] = {  /* Latin/Greek to ELOT 927 */
  2331.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  2332.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  2333.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  2334.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  2335.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2336.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  2337.  96,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  2338.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 123, 124, 125, 126, 127,
  2339. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2340. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2341.  32,  39,  39, UNK, UNK, UNK, 124, UNK,  34, UNK, UNK,  34, UNK,  45, UNK,  45,
  2342. UNK, UNK,  50,  51,  39, UNK,  97,  46, 101, 103, 105,  34, 111, UNK, 116, 120,
  2343. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2344. 112, 113, UNK, 114, 115, 116, 117, 118, 119, 120, 105, 116,  97, 101, 103, 105,
  2345. 116,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2346. 112, 113, 114, 114, 115, 116, 117, 118, 119, 120, 105, 116, 111, 116, 120, UNK
  2347. };
  2348. #endif /* GREEK */
  2349.  
  2350. /* Translation functions ... */
  2351.  
  2352. CHAR                    /* The identity function... */
  2353. #ifdef CK_ANSIC
  2354. ident(CHAR c)                /* (no longer used) */
  2355. #else
  2356. ident(c) CHAR c;
  2357. #endif /* CK_ANSIC */
  2358. { /* ident */
  2359.     return(c);                /* Instead, enter NULL in the  */
  2360. }                    /* table of functions to avoid */
  2361.                     /* needless function calls.    */
  2362.  
  2363. CHAR
  2364. #ifdef CK_ANSIC
  2365. xleft128(CHAR c)
  2366. #else
  2367. xleft128(c) CHAR c;
  2368. #endif /* CK_ANSIC */
  2369. { /* xleft128 */
  2370.     return((c < 128) ? c : '?');
  2371. }
  2372.  
  2373. CHAR
  2374. #ifdef CK_ANSIC
  2375. xleft160(CHAR c)
  2376. #else
  2377. xleft160(c) CHAR c;
  2378. #endif /* CK_ANSIC */
  2379. { /* xleft160 */
  2380.     return((c < 160) ? c : '?');
  2381. }
  2382.  
  2383.  
  2384. CHAR
  2385. #ifdef CK_ANSIC
  2386. xl1as(CHAR c)
  2387. #else
  2388. xl1as(c) CHAR c;
  2389. #endif /* CK_ANSIC */
  2390. { /* xl1as */                 /* Latin-1 to US ASCII... */
  2391.     switch(langs[language].id) {
  2392.  
  2393.       case L_DUTCH:
  2394.     if (c == 255) {            /* Dutch umlaut-y */
  2395.         zmstuff('j');        /* becomes ij */
  2396.         return('i');
  2397.     } else return(yl1as[c]);    /* all others by the book */
  2398.  
  2399.       case L_GERMAN:
  2400.     switch (c) {            /* German, special rules. */
  2401.       case 196:            /* umlaut-A -> Ae */
  2402.         zmstuff('e');
  2403.         return('A');
  2404.       case 214:            /* umlaut-O -> Oe */
  2405.         zmstuff('e');
  2406.         return('O');
  2407.       case 220:            /* umlaut-U -> Ue */
  2408.         zmstuff('e');
  2409.         return('U');
  2410.       case 228:            /* umlaut-a -> ae */
  2411.         zmstuff('e');
  2412.         return('a');
  2413.       case 246:            /* umlaut-o -> oe */
  2414.         zmstuff('e');
  2415.         return('o');
  2416.       case 252:            /* umlaut-u -> ue */
  2417.         zmstuff('e');
  2418.         return('u');
  2419.       case 223:            /* ess-zet -> ss */
  2420.         zmstuff('s');
  2421.         return('s');
  2422.       default: return(yl1as[c]);    /* all others by the book */
  2423.     }
  2424.       case L_DANISH:
  2425.       case L_FINNISH:
  2426.       case L_NORWEGIAN:
  2427.       case L_SWEDISH:
  2428.     switch (c) {            /* Scandanavian languages. */
  2429.       case 196:            /* umlaut-A -> Ae */
  2430.           case 198:            /* AE ligature also -> Ae */
  2431.         zmstuff('e');
  2432.         return('A');
  2433.       case 214:            /* umlaut-O -> Oe */
  2434.       case 216:            /* O-slash -> Oe */
  2435.         zmstuff('e');
  2436.         return('O');
  2437.       case 220:            /* umlaut-U -> Ue */
  2438.       /*  return('Y'); replaced by "Ue" by popular demand. */
  2439.           /*  Y for Umlaut-U is only used in German names. */
  2440.         zmstuff('e');
  2441.         return('U');
  2442.       case 228:            /* umlaut-a -> ae */
  2443.           case 230:            /* ditto for ae ligature */
  2444.         zmstuff('e');
  2445.         return('a');
  2446.       case 246:            /* umlaut-o -> oe */
  2447.       case 248:            /* o-slash -> oe */
  2448.         zmstuff('e');
  2449.         return('o');
  2450.       case 252:            /* umlaut-u -> ue */
  2451.       /*  return('y'); replaced by "ue" by popular demand. */
  2452.         zmstuff('e');
  2453.         return('u');
  2454.       case 197:            /* A-ring -> Aa */
  2455.         zmstuff('a');
  2456.         return('A');
  2457.           case 229:            /* a-ring -> aa */
  2458.         zmstuff('a');
  2459.         return('a');
  2460.       default: return(yl1as[c]);    /* All others by the book */
  2461.     }
  2462.       case L_ICELANDIC:            /* Icelandic. */
  2463.     switch (c) {
  2464.       case 198:            /* uppercase AE -> AE */
  2465.         zmstuff('e');
  2466.         return('A');
  2467.       case 208:            /* uppercase Eth -> D */
  2468.         return('D');
  2469.       case 214:            /* uppercase O-diaeresis -> Oe */
  2470.         zmstuff('e');
  2471.         return('O');
  2472.       case 222:            /* uppercase Thorn -> Th */
  2473.         zmstuff('h');
  2474.         return('T');
  2475.       case 230:            /* lowercase ae -> ae */
  2476.         zmstuff('e');
  2477.         return('a');
  2478.       case 240:            /* lowercase Eth -> d */
  2479.         return('d');
  2480.       case 246:            /* lowercase O-diaeresis -> oe */
  2481.         zmstuff('e');
  2482.         return('o');
  2483.       case 254:            /* lowercase Thorn -> th */
  2484.         zmstuff('h');
  2485.         return('t');
  2486.       default: return(yl1as[c]);    /* All others by the book */
  2487.     }
  2488.       default:
  2489.     return(yl1as[c]);        /* None of the above, by the table. */
  2490.     }
  2491. }
  2492.  
  2493. CHAR                    /* CP1252 to ASCII */
  2494. #ifdef CK_ANSIC
  2495. xw1as(CHAR c)
  2496. #else
  2497. xw1as(c) CHAR c;
  2498. #endif /* CK_ANSIC */
  2499. { /* xw1as */
  2500.     switch(c) {                /* Microsoft name... */
  2501.       case 0x80: return('?');        /* Euro Sign */
  2502.       case 0x82: return('\047');    /* Single Low-9 Quotation Mark */
  2503.       case 0x83: return('f');        /* Latin Small Letter f with Hook */
  2504.       case 0x84: return('"');        /* Double low-9 Quotation Mark */
  2505.       case 0x85: return('-');        /* Horizontal Ellipsis */
  2506.       case 0x86: return('+');        /* Dagger */
  2507.       case 0x87: return('+');        /* Double Dagger */
  2508.       case 0x88: return('^');        /* Modifier Letter Circumflex Accent */
  2509.       case 0x89: return('?');        /* Per Mille Sign */
  2510.       case 0x8A: return('S');        /* Latin Capital Letter S with Caron */
  2511.       case 0x8B: return('<');        /* Single Left Angle Quotation Mark */
  2512.       case 0x8C: return('O');        /* Latin Capital Ligature OE */
  2513.       case 0x8E: return('Z');        /* Latin Capital Letter Z with Caron */
  2514.       case 0x91: return('\047');    /* Left Single Quotation Mark */
  2515.       case 0x92: return('\047');    /* Right Single Quotation Mark */
  2516.       case 0x93: return('"');        /* Left Double Quotation Mark */
  2517.       case 0x94: return('"');        /* Right Double Quotation Mark */
  2518.       case 0x95: return('.');        /* Bullet */
  2519.       case 0x96: return('-');        /* En Dash */
  2520.       case 0x97: return('-');        /* Em Dash */
  2521.       case 0x98: return('~');        /* Small Tilde */
  2522.       case 0x99: return('T');        /* Trade Mark Sign */
  2523.       case 0x9A: return('s');        /* Latin Small Letter s with Caron */
  2524.       case 0x9B: return('>');        /* Single Right Angle Quotation Mark */
  2525.       case 0x9C: return('o');        /* Latin Small Ligature OE */
  2526.       case 0x9E: return('z');        /* Latin Small Letter z with Caron */
  2527.       case 0x9F: return('Y');        /* Latin Capital Letter Y Diaeresis */
  2528.       default:
  2529.     if (c > 0x80 && c < 0xa0)
  2530.       return('?');
  2531.     else
  2532.       return(yl1as[c]);
  2533.     }
  2534. }
  2535.  
  2536. CHAR                    /* CP1252 to Latin-1 */
  2537. #ifdef CK_ANSIC
  2538. xw1l1(CHAR c)
  2539. #else
  2540. xw1l1(c) CHAR c;
  2541. #endif /* CK_ANSIC */
  2542. { /* xw1l1 */
  2543.     if (c == 0x95) return(0xb7);    /* Middle dot */
  2544.     return((c < 160) ? xw1as(c) : c);
  2545. }
  2546.  
  2547. CHAR                    /* Latin-1 to German */
  2548. #ifdef CK_ANSIC
  2549. xl1ge(CHAR c)
  2550. #else
  2551. xl1ge(c) CHAR c;
  2552. #endif /* CK_ANSIC */
  2553. { /* xl1ge */
  2554.     return(yl1ge[c]);
  2555. }
  2556.  
  2557. CHAR                    /* German to Latin-1 */
  2558. #ifdef CK_ANSIC
  2559. xgel1(CHAR c)
  2560. #else
  2561. xgel1(c) CHAR c;
  2562. #endif /* CK_ANSIC */
  2563. { /* xgel1 */
  2564.     if (c & 0x80)
  2565.       return(UNK);
  2566.     return(ygel1[c]);
  2567. }
  2568.  
  2569. CHAR
  2570. #ifdef CK_ANSIC
  2571. xgeas(CHAR c)
  2572. #else
  2573. xgeas(c) CHAR c;
  2574. #endif /* CK_ANSIC */
  2575. { /* xgeas */                /* German ISO 646 to ASCII */
  2576.     if (c & 0x80)
  2577.       return(UNK);
  2578.     switch (c) {
  2579.       case 91:                /* umlaut-A -> Ae */
  2580.     zmstuff('e');
  2581.     return('A');
  2582.       case 92:                /* umlaut-O -> Oe */
  2583.     zmstuff('e');
  2584.     return('O');
  2585.       case 93:                /* umlaut-U -> Ue */
  2586.     zmstuff('e');
  2587.     return('U');
  2588.       case 123:                /* umlaut-a -> ae */
  2589.     zmstuff('e');
  2590.     return('a');
  2591.       case 124:                /* umlaut-o -> oe */
  2592.     zmstuff('e');
  2593.     return('o');
  2594.       case 125:                /* umlaut-u -> ue */
  2595.     zmstuff('e');
  2596.     return('u');
  2597.       case 126:                /* ess-zet -> ss */
  2598.     zmstuff('s');
  2599.     return('s');
  2600.       default:  return(c);        /* all others stay the same */
  2601.     }
  2602. }
  2603.  
  2604. CHAR
  2605. #ifdef CK_ANSIC
  2606. xl1w1(CHAR c)
  2607. #else
  2608. xl1w1(c) CHAR c;
  2609. #endif /* CK_ANSIC */
  2610. { /* xl1w1 */                /* Latin-1 to CP1252 (Windows L1) */
  2611.     if (c > 127 && c < 160)
  2612.       return(UNK);
  2613.     else
  2614.       return(c);
  2615. }
  2616.  
  2617. CHAR
  2618. #ifdef CK_ANSIC
  2619. xduas(CHAR c)
  2620. #else
  2621. xduas(c) CHAR c;
  2622. #endif /* CK_ANSIC */
  2623. { /* xduas */                /* Dutch ISO 646 to US ASCII */
  2624.     if (c & 0x80)
  2625.       return(UNK);
  2626.     switch (c) {
  2627.       case 64:  return(UNK);        /* 3/4 */
  2628.       case 91:                /* y-diaeresis */
  2629.     zmstuff('j');
  2630.     return('i');
  2631.       case 92:  return(UNK);        /* 1/2 */
  2632.       case 93:  return(124);        /* vertical bar */
  2633.       case 123: return(34);        /* diaeresis */
  2634.       case 124: return(UNK);        /* Florin */
  2635.       case 125: return(UNK);        /* 1/4 */
  2636.       case 126: return(39);        /* Apostrophe */
  2637.       default:  return(c);
  2638.     }
  2639. }
  2640.  
  2641. CHAR
  2642. #ifdef CK_ANSIC
  2643. xfias(CHAR c)
  2644. #else
  2645. xfias(c) CHAR c;
  2646. #endif /* CK_ANSIC */
  2647. { /* xfias */                /* Finnish ISO 646 to US ASCII */
  2648.     if (c & 0x80)
  2649.       return(UNK);
  2650.     switch (c) {
  2651.       case 91:                /* A-diaeresis */
  2652.     zmstuff('e');
  2653.     return('A');
  2654.       case 92:                /* O-diaeresis */
  2655.     zmstuff('e');
  2656.     return('O');
  2657.       case 93:                /* A-ring */
  2658.     zmstuff('a');
  2659.     return('A');
  2660.       case 94:                /* U-diaeresis */
  2661.     /* return('Y'); */
  2662.     zmstuff('e');
  2663.     return('U');
  2664.       case 96:                /* e-acute */
  2665.     return('e');
  2666.       case 123:                /* a-diaeresis */
  2667.     zmstuff('e');
  2668.     return('a');
  2669.       case 124:                /* o-diaeresis */
  2670.     zmstuff('e');
  2671.     return('o');
  2672.       case 125:                /* a-ring */
  2673.     zmstuff('a');
  2674.     return('a');
  2675.       case 126:                /* u-diaeresis */
  2676.     /* return('y'); */
  2677.     zmstuff('e');
  2678.     return('U');
  2679.       default:
  2680.     return(c);
  2681.     }
  2682. }
  2683.  
  2684. CHAR
  2685. #ifdef CK_ANSIC
  2686. xfras(CHAR c)
  2687. #else
  2688. xfras(c) CHAR c;
  2689. #endif /* CK_ANSIC */
  2690. { /* xfras */                /* French ISO 646 to US ASCII */
  2691.     if (c & 0x80)
  2692.       return(UNK);
  2693.     switch (c) {
  2694.       case 64:  return(97);        /* a grave */
  2695.       case 91:  return(UNK);        /* degree sign */
  2696.       case 92:  return(99);        /* c cedilla */
  2697.       case 93:  return(UNK);        /* paragraph sign */
  2698.       case 123: return(101);        /* e acute */
  2699.       case 124: return(117);        /* u grave */
  2700.       case 125: return(101);        /* e grave */
  2701.       case 126: return(34);        /* diaeresis */
  2702.       default:  return(c);
  2703.     }
  2704. }
  2705.  
  2706. CHAR
  2707. #ifdef CK_ANSIC
  2708. xfcas(CHAR c)
  2709. #else
  2710. xfcas(c) CHAR c;
  2711. #endif /* CK_ANSIC */
  2712. { /* xfcas */                /* French Canadian ISO 646 to ASCII */
  2713.     if (c & 0x80)
  2714.       return(UNK);
  2715.     switch (c) {
  2716.       case 64:  return('a');        /* a grave */
  2717.       case 91:  return('a');        /* a circumflex */
  2718.       case 92:  return('c');        /* c cedilla */
  2719.       case 93:  return('e');        /* e circumflex */
  2720.       case 94:  return('i');        /* i circumflex */
  2721.       case 96:  return('o');        /* o circumflex */
  2722.       case 123: return('e');        /* e acute */
  2723.       case 124: return('u');        /* u grave */
  2724.       case 125: return('e');        /* e grave */
  2725.       case 126: return('u');        /* u circumflex */
  2726.       default:  return(c);
  2727.     }
  2728. }
  2729.  
  2730. CHAR
  2731. #ifdef CK_ANSIC
  2732. xitas(CHAR c)
  2733. #else
  2734. xitas(c) CHAR c;
  2735. #endif /* CK_ANSIC */
  2736. { /* xitas */                /* Italian ISO 646 to ASCII */
  2737.     if (c & 0x80)
  2738.       return(UNK);
  2739.     switch (c) {
  2740.       case 91:  return(UNK);        /* degree */
  2741.       case 92:  return('c');        /* c cedilla */
  2742.       case 93:  return('e');        /* e acute */
  2743.       case 96:  return('u');        /* u grave */
  2744.       case 123: return('a');        /* a grave */
  2745.       case 124: return('o');        /* o grave */
  2746.       case 125: return('e');        /* e grave */
  2747.       case 126: return('i');        /* i grave */
  2748.       default:  return(c);
  2749.     }
  2750. }
  2751.  
  2752. CHAR
  2753. #ifdef CK_ANSIC
  2754. xneas(CHAR c)
  2755. #else
  2756. xneas(c) CHAR c;
  2757. #endif /* CK_ANSIC */
  2758. { /* xneas */                /* NeXT to ASCII */
  2759.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2760.     if (c == 234) {            /* handle OE digraph. */
  2761.         zmstuff('E');
  2762.         return('O');
  2763.     } else if (c == 250) {        /* Also lowercase oe. */
  2764.         zmstuff('e');
  2765.         return('o');
  2766.     }
  2767.     }
  2768.     c = xnel1(c);            /* Convert to Latin-1 */
  2769.     return(yl1as[c]);            /* Convert Latin-1 to ASCII */
  2770. }
  2771.  
  2772. CHAR
  2773. #ifdef CK_ANSIC
  2774. xnoas(CHAR c)
  2775. #else
  2776. xnoas(c) CHAR c;
  2777. #endif /* CK_ANSIC */
  2778. { /* xnoas */                /* Norge/Danish ISO 646 to ASCII */
  2779.     if (c & 0x80)
  2780.       return(UNK);
  2781.     switch (c) {
  2782.       case 91:
  2783.     zmstuff('E');            /* AE digraph */
  2784.     return('A');
  2785.       case 92: return('O');        /* O slash */
  2786.       case 93:                /* A ring */
  2787.     zmstuff('a');
  2788.     return('A');
  2789.       case 123:                /* ae digraph */
  2790.     zmstuff('e');
  2791.     return('a');
  2792.       case 124: return('o');        /* o slash */
  2793.       case 125:                /* a ring */
  2794.     zmstuff('a');
  2795.     return('a');
  2796.       default:  return(c);
  2797.     }
  2798. }
  2799.  
  2800. CHAR
  2801. #ifdef CK_ANSIC
  2802. xpoas(CHAR c)
  2803. #else
  2804. xpoas(c) CHAR c;
  2805. #endif /* CK_ANSIC */
  2806. { /* xpoas */                /* Portuguese ISO 646 to ASCII */
  2807.     if (c & 0x80)
  2808.       return(UNK);
  2809.     switch (c) {
  2810.       case 91:  return('A');        /* A tilde */
  2811.       case 92:  return('C');        /* C cedilla */
  2812.       case 93:  return('O');        /* O tilde */
  2813.       case 123: return('a');        /* a tilde */
  2814.       case 124: return('c');        /* c cedilla */
  2815.       case 125: return('o');        /* o tilde */
  2816.       default:  return(c);
  2817.     }
  2818. }
  2819.  
  2820. CHAR
  2821. #ifdef CK_ANSIC
  2822. xspas(CHAR c)
  2823. #else
  2824. xspas(c) CHAR c;
  2825. #endif /* CK_ANSIC */
  2826. { /* xspas */                /* Spanish ISO 646 to ASCII */
  2827.     if (c & 0x80)
  2828.       return(UNK);
  2829.     switch (c) {
  2830.       case 91:  return(33);        /* Inverted exclamation */
  2831.       case 92:  return('N');        /* N tilde */
  2832.       case 93:  return(63);        /* Inverted question mark */
  2833.       case 123: return(UNK);        /* degree */
  2834.       case 124: return('n');        /* n tilde */
  2835.       case 125: return('c');        /* c cedilla */
  2836.       default:  return(c);
  2837.     }
  2838. }
  2839.  
  2840. CHAR
  2841. #ifdef CK_ANSIC
  2842. xswas(CHAR c)
  2843. #else
  2844. xswas(c) CHAR c;
  2845. #endif /* CK_ANSIC */
  2846. { /* xswas */                /* Swedish ISO 646 to ASCII */
  2847.     if (c & 0x80)
  2848.       return(UNK);
  2849.     switch (c) {
  2850.       case 64:  return('E');        /* E acute */
  2851.       case 91:                /* A diaeresis */
  2852.     zmstuff('e');
  2853.     return('A');
  2854.       case 92:                /* O diaeresis */
  2855.     zmstuff('e');
  2856.     return('O');
  2857.       case 93:                /* A ring */
  2858.     zmstuff('a');
  2859.     return('A');
  2860.       case 94:                /* U diaeresis */
  2861.     /* return('Y'); */
  2862.     zmstuff('e');
  2863.     return('U');
  2864.       case 96:  return('e');        /* e acute */
  2865.       case 123:                /* a diaeresis */
  2866.     zmstuff('e');
  2867.     return('a');
  2868.       case 124:                /* o diaeresis */
  2869.     zmstuff('e');
  2870.     return('o');
  2871.       case 125:                /* a ring */
  2872.     zmstuff('a');
  2873.     return('a');
  2874.       case 126:                /* u diaeresis */
  2875.     /* return('y'); */
  2876.     zmstuff('e');
  2877.     return('u');
  2878.       default:  return(c);
  2879.     }
  2880. }
  2881.  
  2882. CHAR
  2883. #ifdef CK_ANSIC
  2884. xchas(CHAR c)
  2885. #else
  2886. xchas(c) CHAR c;
  2887. #endif /* CK_ANSIC */
  2888. { /* xchas */                /* Swiss ISO 646 to ASCII */
  2889.     if (c & 0x80)
  2890.       return(UNK);
  2891.     switch (c) {
  2892.       case 35:  return('u');        /* u grave */
  2893.       case 64:  return('a');        /* a grave */
  2894.       case 91:  return('e');        /* e acute */
  2895.       case 92:  return('c');        /* c cedilla */
  2896.       case 93:  return('e');        /* e circumflex */
  2897.       case 94:  return('i');        /* i circumflex */
  2898.       case 95:  return('e');        /* e grave */
  2899.       case 96:  return('o');        /* o circumflex */
  2900.       case 123:                /* a diaeresis */
  2901.     zmstuff('e');
  2902.     return('a');
  2903.       case 124:                /* o diaeresis */
  2904.     zmstuff('e');
  2905.     return('o');
  2906.       case 125:                /* u diaeresis */
  2907.     zmstuff('e');
  2908.     return('u');
  2909.       case 126: return('u');        /* u circumflex */
  2910.       default:  return(c);
  2911.     }
  2912. }
  2913.  
  2914. CHAR
  2915. #ifdef CK_ANSIC
  2916. xhuas(CHAR c)
  2917. #else
  2918. xhuas(c) CHAR c;
  2919. #endif /* CK_ANSIC */
  2920. { /* xhuas */                /* Hungarian ISO 646 to ASCII */
  2921.     if (c & 0x80)
  2922.       return(UNK);
  2923.     switch (c) {
  2924.       case 64:  return('A');        /* A acute */
  2925.       case 91:  return('E');        /* E acute */
  2926.       case 92:  return('O');        /* O diaeresis */
  2927.       case 93:  return('U');        /* U diaeresis */
  2928.       case 96:  return('a');        /* a acute */
  2929.       case 123: return('e');        /* e acute */
  2930.       case 124: return('o');        /* o acute */
  2931.       case 125: return('u');        /* u acute */
  2932.       case 126: return(34);        /* double acute accent */
  2933.       default:  return(c);
  2934.     }
  2935. }
  2936.  
  2937. CHAR
  2938. #ifdef CK_ANSIC
  2939. xdmas(CHAR c)
  2940. #else
  2941. xdmas(c) CHAR c;
  2942. #endif /* CK_ANSIC */
  2943. { /* xdmas */                /* DEC MCS to ASCII */
  2944.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2945.     if (c == 215) {            /* handle OE digraph. */
  2946.         zmstuff('E');
  2947.         return('O');
  2948.     } else if (c == 247) {        /* Also lowercase oe. */
  2949.         zmstuff('e');
  2950.         return('o');
  2951.     }
  2952.     }
  2953.     return(yl1as[c]);            /* Otherwise treat like Latin-1 */
  2954. }
  2955.  
  2956. CHAR
  2957. #ifdef CK_ANSIC
  2958. xdgas(CHAR c)
  2959. #else
  2960. xdgas(c) CHAR c;
  2961. #endif /* CK_ANSIC */
  2962. { /*  xdgas */                /* Data General to ASCII */
  2963.     switch(c) {
  2964.       case 180: return('f');        /* Florin */
  2965.       case 183: return('<');        /* Less-equal */
  2966.       case 184: return('>');        /* Greater-equal */
  2967.       case 186: return(96);        /* Grave accent */
  2968.       case 191: return('^');        /* Uparrow */
  2969.       case 215:
  2970.     if (langs[language].id == L_FRENCH) { /* OE digraph */
  2971.         zmstuff('E');
  2972.         return('O');
  2973.     } else return('O');
  2974.       case 247:
  2975.     if (langs[language].id == L_FRENCH) { /* oe digraph */
  2976.         zmstuff('e');
  2977.         return('o');
  2978.     } else return('o');
  2979.       case 175: case 179: case 220: case 222:
  2980.       case 223: case 254: case 255:
  2981.     return(UNK);
  2982.       default:                /* The rest, convert to Latin-1 */
  2983.     return(yl1as[ydgl1[c]]);    /* and from there to ASCII */
  2984.     }
  2985. }
  2986.  
  2987. CHAR
  2988. #ifdef CK_ANSIC
  2989. xr8as(CHAR c)
  2990. #else
  2991. xr8as(c) CHAR c;
  2992. #endif /* CK_ANSIC */
  2993. { /*  xr8as */                /* Hewlett Packard Roman8 to ASCII */
  2994.     switch(c) {
  2995.       case 175: return('L');        /* Lira */
  2996.       case 190: return('f');        /* Florin */
  2997.       case 235: return('S');        /* S caron */
  2998.       case 236: return('s');        /* s caron */
  2999.       case 246: return('-');        /* Horizontal bar */
  3000.       case 252: return('*');        /* Solid box */
  3001.       default:                /* The rest, convert to Latin-1 */
  3002.     return(yl1as[yr8l1[c]]);    /* and from there to ASCII */
  3003.     }
  3004. }
  3005.  
  3006. CHAR
  3007. #ifdef CK_ANSIC
  3008. xukl1(CHAR c)
  3009. #else
  3010. xukl1(c) CHAR c;
  3011. #endif /* CK_ANSIC */
  3012. { /* xukl1 */                /* UK ASCII to Latin-1 */
  3013.     if (c & 0x80)
  3014.       return(UNK);
  3015.     if (c == 35)
  3016.       return(163);
  3017.     else return(c);
  3018. }
  3019.  
  3020. CHAR
  3021. #ifdef CK_ANSIC
  3022. xl1uk(CHAR c)
  3023. #else
  3024. xl1uk(c) CHAR c;
  3025. #endif /* CK_ANSIC */
  3026. { /* xl1uk */                /* Latin-1 to UK ASCII */
  3027.     if (c == 163)
  3028.       return(35);
  3029.     else return(yl1as[c]);
  3030. }
  3031.  
  3032. CHAR                    /* Latin-1 to French ISO 646 */
  3033. #ifdef CK_ANSIC
  3034. xl1fr(CHAR c)
  3035. #else
  3036. xl1fr(c) CHAR c;
  3037. #endif /* CK_ANSIC */
  3038. { /* xl1fr */
  3039.     return(yl1fr[c]);
  3040. }
  3041.  
  3042.  
  3043. CHAR                    /* French ISO 646 to Latin-1 */
  3044. #ifdef CK_ANSIC
  3045. xfrl1(CHAR c)
  3046. #else
  3047. xfrl1(c) CHAR c;
  3048. #endif /* CK_ANSIC */
  3049. { /* xfrl1 */
  3050.     if (c & 0x80)
  3051.       return(UNK);
  3052.     return(yfrl1[c]);
  3053. }
  3054.  
  3055. CHAR                    /* Latin-1 to Dutch ASCII */
  3056. #ifdef CK_ANSIC
  3057. xl1du(CHAR c)
  3058. #else
  3059. xl1du(c) CHAR c;
  3060. #endif /* CK_ANSIC */
  3061. { /* xl1du */
  3062.     return(yl1du[c]);
  3063. }
  3064.  
  3065. CHAR
  3066. #ifdef CK_ANSIC
  3067. xdul1(CHAR c)
  3068. #else
  3069. xdul1(c) CHAR c;
  3070. #endif /* CK_ANSIC */
  3071. { /* xdul1 */                /* Dutch ISO 646 to Latin-1 */
  3072.     if (c & 0x80)
  3073.       return(UNK);
  3074.     return(ydul1[c]);
  3075. }
  3076.  
  3077. CHAR
  3078. #ifdef CK_ANSIC
  3079. xfil1(CHAR c)
  3080. #else
  3081. xfil1(c) CHAR c;
  3082. #endif /* CK_ANSIC */
  3083. { /* xfil1 */                /* Finnish ISO 646 to Latin-1 */
  3084.     if (c & 0x80)
  3085.       return(UNK);
  3086.     return(yfil1[c]);
  3087. }
  3088.  
  3089. CHAR
  3090. #ifdef CK_ANSIC
  3091. xl1fi(CHAR c)
  3092. #else
  3093. xl1fi(c) CHAR c;
  3094. #endif /* CK_ANSIC */
  3095. { /* xl1fi */                /* Latin-1 to Finnish ISO 646 */
  3096.     return(yl1fi[c]);
  3097. }
  3098.  
  3099. CHAR
  3100. #ifdef CK_ANSIC
  3101. xfcl1(CHAR c)
  3102. #else
  3103. xfcl1(c) CHAR c;
  3104. #endif /* CK_ANSIC */
  3105. { /* xfcl1 */                /* French Canadian ISO646 to Latin-1 */
  3106.     if (c & 0x80)
  3107.       return(UNK);
  3108.     return(yfcl1[c]);
  3109. }
  3110.  
  3111. CHAR
  3112. #ifdef CK_ANSIC
  3113. xl1fc(CHAR c)
  3114. #else
  3115. xl1fc(c) CHAR c;
  3116. #endif /* CK_ANSIC */
  3117. { /* xl1fc */                /* Latin-1 to French Canadian ISO646 */
  3118.     return(yl1fc[c]);
  3119. }
  3120.  
  3121. CHAR
  3122. #ifdef CK_ANSIC
  3123. xitl1(CHAR c)
  3124. #else
  3125. xitl1(c) CHAR c;
  3126. #endif /* CK_ANSIC */
  3127. { /* xitl1 */                /* Italian ISO 646 to Latin-1 */
  3128.     if (c & 0x80)
  3129.       return(UNK);
  3130.     return(yitl1[c]);
  3131. }
  3132.  
  3133. CHAR
  3134. #ifdef CK_ANSIC
  3135. xl1it(CHAR c)
  3136. #else
  3137. xl1it(c) CHAR c;
  3138. #endif /* CK_ANSIC */
  3139. { /* xl1it */                /* Latin-1 to Italian ISO 646 */
  3140.     return(yl1it[c]);
  3141. }
  3142.  
  3143. CHAR
  3144. #ifdef CK_ANSIC
  3145. xnel1(CHAR c)
  3146. #else
  3147. xnel1(c) CHAR c;
  3148. #endif /* CK_ANSIC */
  3149. { /* xnel1 */                 /* NeXT to Latin-1 */
  3150.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  3151.     if (c == 234) {            /* handle OE digraph. */
  3152.         zmstuff('E');
  3153.         return('O');
  3154.     } else if (c == 250) {        /* Also lowercase oe. */
  3155.         zmstuff('e');
  3156.         return('o');
  3157.     }
  3158.     }
  3159.     return(ynel1[c]);
  3160. }
  3161.  
  3162. CHAR
  3163. #ifdef CK_ANSIC
  3164. xnel9(CHAR c)
  3165. #else
  3166. xnel9(c) CHAR c;
  3167. #endif /* CK_ANSIC */
  3168. { /* xnel9 */                 /* NeXT to Latin-9 */
  3169.     switch (c) {
  3170.       case 234: return(188);        /* OE */
  3171.       case 250: return(189);        /* oe */
  3172.       case 188: return(234);        /* keep it invertible... */
  3173.       case 189: return(250);        /* oe */
  3174.       default:
  3175.     return(ynel1[c]);
  3176.     }
  3177. }
  3178.  
  3179. CHAR
  3180. #ifdef CK_ANSIC
  3181. xl1ne(CHAR c)
  3182. #else
  3183. xl1ne(c) CHAR c;
  3184. #endif /* CK_ANSIC */
  3185. { /* xl1ne */                 /* Latin-1 to NeXT */
  3186.     return(yl1ne[c]);
  3187. }
  3188.  
  3189. CHAR
  3190. #ifdef CK_ANSIC
  3191. xl9ne(CHAR c)
  3192. #else
  3193. xl9ne(c) CHAR c;
  3194. #endif /* CK_ANSIC */
  3195. { /* xl9ne */                 /* Latin-9 to NeXT */
  3196.     switch (c) {
  3197.       case 188: return(234);        /* OE */
  3198.       case 189: return(250);        /* oe */
  3199.       case 234: return(188);        /* OE */
  3200.       case 250: return(189);        /* oe */
  3201.       default:
  3202.     return(yl1ne[c]);
  3203.     }
  3204. }
  3205.  
  3206. CHAR
  3207. #ifdef CK_ANSIC
  3208. xnol1(CHAR c)
  3209. #else
  3210. xnol1(c) CHAR c;
  3211. #endif /* CK_ANSIC */
  3212. { /* xnol1 */                 /* Norway/Denmark ISO 646 to Latin-1 */
  3213.     if (c & 0x80)
  3214.       return(UNK);
  3215.     return(ynol1[c]);
  3216. }
  3217.  
  3218. CHAR
  3219. #ifdef CK_ANSIC
  3220. xl1no(CHAR c)
  3221. #else
  3222. xl1no(c) CHAR c;
  3223. #endif /* CK_ANSIC */
  3224. { /* xl1no */                 /* Latin-1 to Norway/Denmark ISO 646 */
  3225.     return(yl1no[c]);
  3226. }
  3227.  
  3228. CHAR
  3229. #ifdef CK_ANSIC
  3230. xpol1(CHAR c)
  3231. #else
  3232. xpol1(c) CHAR c;
  3233. #endif /* CK_ANSIC */
  3234. { /* xpol1 */                /* Portuguese ISO 646 to Latin-1 */
  3235.     if (c & 0x80)
  3236.       return(UNK);
  3237.     return(ypol1[c]);
  3238. }
  3239.  
  3240. CHAR
  3241. #ifdef CK_ANSIC
  3242. xl1po(CHAR c)
  3243. #else
  3244. xl1po(c) CHAR c;
  3245. #endif /* CK_ANSIC */
  3246. { /* xl1po */                /* Latin-1 to Portuguese ISO 646 */
  3247.     return(yl1po[c]);
  3248. }
  3249.  
  3250. CHAR
  3251. #ifdef CK_ANSIC
  3252. xspl1(CHAR c)
  3253. #else
  3254. xspl1(c) CHAR c;
  3255. #endif /* CK_ANSIC */
  3256. { /* xspl1 */                /* Spanish ISO 646 to Latin-1 */
  3257.     if (c & 0x80)
  3258.       return(UNK);
  3259.     return(yspl1[c]);
  3260. }
  3261.  
  3262. CHAR
  3263. #ifdef CK_ANSIC
  3264. xl1sp(CHAR c)
  3265. #else
  3266. xl1sp(c) CHAR c;
  3267. #endif /* CK_ANSIC */
  3268. { /* xl1sp */                /* Latin-1 to Spanish ISO 646 */
  3269.     return(yl1sp[c]);
  3270. }
  3271.  
  3272. CHAR
  3273. #ifdef CK_ANSIC
  3274. xswl1(CHAR c)
  3275. #else
  3276. xswl1(c) CHAR c;
  3277. #endif /* CK_ANSIC */
  3278. { /* xswl1 */                /* Swedish ISO 646 to Latin-1 */
  3279.     if (c & 0x80)
  3280.       return(UNK);
  3281.     return(yswl1[c]);
  3282. }
  3283.  
  3284. CHAR
  3285. #ifdef CK_ANSIC
  3286. xl1sw(CHAR c)
  3287. #else
  3288. xl1sw(c) CHAR c;
  3289. #endif /* CK_ANSIC */
  3290. { /* xl1sw */                /* Latin-1 to Swedish ISO 646 */
  3291.     return(yl1sw[c]);
  3292. }
  3293.  
  3294. CHAR
  3295. #ifdef CK_ANSIC
  3296. xchl1(CHAR c)
  3297. #else
  3298. xchl1(c) CHAR c;
  3299. #endif /* CK_ANSIC */
  3300. { /* xchl1 */                /* Swiss ISO 646 to Latin-1 */
  3301.     if (c & 0x80)
  3302.       return(UNK);
  3303.     return(ychl1[c]);
  3304. }
  3305.  
  3306. CHAR
  3307. #ifdef CK_ANSIC
  3308. xl1ch(CHAR c)
  3309. #else
  3310. xl1ch(c) CHAR c;
  3311. #endif /* CK_ANSIC */
  3312. { /* xl1ch */                /* Latin-1 to Swiss ISO 646 */
  3313.     return(yl1ch[c]);
  3314. }
  3315.  
  3316. CHAR
  3317. #ifdef CK_ANSIC
  3318. xhul1(CHAR c)
  3319. #else
  3320. xhul1(c) CHAR c;
  3321. #endif /* CK_ANSIC */
  3322. { /* xhul1 */                /* Hungarian ISO 646 to Latin-1 */
  3323.     if (c & 0x80)
  3324.       return(UNK);
  3325.     return(yhul1[c]);
  3326. }
  3327.  
  3328. CHAR
  3329. #ifdef CK_ANSIC
  3330. xl1hu(CHAR c)
  3331. #else
  3332. xl1hu(c) CHAR c;
  3333. #endif /* CK_ANSIC */
  3334. { /* xl1hu */                /* Latin-1 to Hungarian ISO 646 */
  3335.     return(yl1hu[c]);
  3336. }
  3337.  
  3338. CHAR
  3339. #ifdef CK_ANSIC
  3340. xl1dm(CHAR c)
  3341. #else
  3342. xl1dm(c) CHAR c;
  3343. #endif /* CK_ANSIC */
  3344. { /* xl1dm */                /* Latin-1 to DEC MCS */
  3345.     return(yl1dm[c]);
  3346. }
  3347.  
  3348. CHAR
  3349. #ifdef CK_ANSIC
  3350. xl9dm(CHAR c)
  3351. #else
  3352. xl9dm(c) CHAR c;
  3353. #endif /* CK_ANSIC */
  3354. { /* xl9dm */                /* Latin-9 to DEC MCS */
  3355.     switch (c) {
  3356.       case 188: return(215);
  3357.       case 189: return(247);
  3358.       case 215: return(188);
  3359.       case 247: return(189);
  3360.       default:
  3361.     return(yl1dm[c]);
  3362.     }
  3363. }
  3364.  
  3365. CHAR
  3366. #ifdef CK_ANSIC
  3367. xl9w1(CHAR c)
  3368. #else
  3369. xl9w1(c) CHAR c;
  3370. #endif /* CK_ANSIC */
  3371. { /* xl9w1 */                /* Latin-9 to CP1252 */
  3372.     if (c < 128)
  3373.       return(c);
  3374.     else if (c < 160)
  3375.       return('?');
  3376.     switch (c) {
  3377.       case 0xa4: return(0x80);        /* Euro */
  3378.       case 0xa6: return(0x8a);        /* S-caron */
  3379.       case 0xa8: return(0x9a);        /* s-caron */
  3380.       case 0xb4: return(0x8e);        /* Z-caron */
  3381.       case 0xb8: return(0x9e);        /* z-caron */
  3382.       case 0xbc: return(0x8c);        /* OE */
  3383.       case 0xbd: return(0x9c);        /* oe */
  3384.       case 0xbe: return(0x9f);        /* Y-diaeresis */
  3385.       default:
  3386.     return(c);
  3387.     }
  3388. }
  3389.  
  3390. CHAR
  3391. #ifdef CK_ANSIC
  3392. xl1dg(CHAR c)
  3393. #else
  3394. xl1dg(c) CHAR c;
  3395. #endif /* CK_ANSIC */
  3396. { /* xl1dg */                /* Latin-1 to DG ICS */
  3397.     return(yl1dg[c]);
  3398. }
  3399.  
  3400. CHAR
  3401. #ifdef CK_ANSIC
  3402. xdml1(CHAR c)
  3403. #else
  3404. xdml1(c) CHAR c;
  3405. #endif /* CK_ANSIC */
  3406. { /* xdml1 */                /* DEC MCS to Latin-1 */
  3407.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  3408.     if (c == 215) {            /* handle OE digraph. */
  3409.         zmstuff('E');
  3410.         return('O');
  3411.     } else if (c == 247) {        /* Also lowercase oe. */
  3412.         zmstuff('e');
  3413.         return('o');
  3414.     }
  3415.     }
  3416.     return(ydml1[c]);
  3417. }
  3418.  
  3419. CHAR
  3420. #ifdef CK_ANSIC
  3421. xdml9(CHAR c)
  3422. #else
  3423. xdml9(c) CHAR c;
  3424. #endif /* CK_ANSIC */
  3425. { /* xdml9 */                /* DEC MCS to Latin-9 */
  3426.     switch (c) {
  3427.       case 215: return(188);        /* OE */
  3428.       case 247: return(189);        /* oe */
  3429.       case 188: return(215);        /* and swap the other two... */
  3430.       case 189: return(247);        /* (1/4 and 1/2) */
  3431.       default:                /* to keep it invertible */
  3432.     return(ydml1[c]);
  3433.     }
  3434. }
  3435.  
  3436. CHAR
  3437. #ifdef CK_ANSIC
  3438. xdgl1(CHAR c)
  3439. #else
  3440. xdgl1(c) CHAR c;
  3441. #endif /* CK_ANSIC */
  3442. { /* xdgl1 */                /* DG International CS to Latin-1 */
  3443.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  3444.     if (c == 215) {            /* handle OE digraph. */
  3445.         zmstuff('E');
  3446.         return('O');
  3447.     } else if (c == 247) {        /* Also lowercase oe. */
  3448.         zmstuff('e');
  3449.         return('o');
  3450.     }
  3451.     }
  3452.     return(ydgl1[c]);
  3453. }
  3454.  
  3455. CHAR
  3456. #ifdef CK_ANSIC
  3457. xr8l1(CHAR c)
  3458. #else
  3459. xr8l1(c) CHAR c;
  3460. #endif /* CK_ANSIC */
  3461. { /* xr8l1 */                /* Hewlett Packard Roman8 to Latin-1 */
  3462.     return(yr8l1[c]);
  3463. }
  3464.  
  3465. CHAR
  3466. #ifdef CK_ANSIC
  3467. xl1r8(CHAR c)
  3468. #else
  3469. xl1r8(c) CHAR c;
  3470. #endif /* CK_ANSIC */
  3471. { /* xl1r8 */                /* Latin-1 to Hewlett Packard Roman8 */
  3472.     return(yl1r8[c]);
  3473. }
  3474.  
  3475. /* Translation functions for receiving files and translating them into ASCII */
  3476.  
  3477. CHAR
  3478. #ifdef CK_ANSIC
  3479. zl1as(CHAR c)
  3480. #else
  3481. zl1as(c) CHAR c;
  3482. #endif /* CK_ANSIC */
  3483. { /* zl1as */
  3484.     switch(langs[language].id) {
  3485.  
  3486.       case L_DUTCH:
  3487.     if (c == 255) {            /* Dutch umlaut-y */
  3488.         zdstuff('j');        /* becomes ij */
  3489.         return('i');
  3490.     } else return(yl1as[c]);    /* all others by the book */
  3491.  
  3492.       case L_GERMAN:
  3493.     switch (c) {            /* German, special rules. */
  3494.       case 196:            /* umlaut-A -> Ae */
  3495.         zdstuff('e');
  3496.         return('A');
  3497.       case 214:            /* umlaut-O -> Oe */
  3498.         zdstuff('e');
  3499.         return('O');
  3500.       case 220:            /* umlaut-U -> Ue */
  3501.         zdstuff('e');
  3502.         return('U');
  3503.       case 228:            /* umlaut-a -> ae */
  3504.         zdstuff('e');
  3505.         return('a');
  3506.       case 246:            /* umlaut-o -> oe */
  3507.         zdstuff('e');
  3508.         return('o');
  3509.       case 252:            /* umlaut-u -> ue */
  3510.         zdstuff('e');
  3511.         return('u');
  3512.       case 223:            /* ess-zet -> ss */
  3513.         zdstuff('s');
  3514.         return('s');
  3515.       default: return(yl1as[c]);    /* all others by the book */
  3516.     }
  3517.       case L_DANISH:
  3518.       case L_FINNISH:
  3519.       case L_NORWEGIAN:
  3520.       case L_SWEDISH:
  3521.     switch (c) {            /* Scandanavian languages. */
  3522.       case 196:            /* umlaut-A -> Ae */
  3523.         zdstuff('e');
  3524.         return('A');
  3525.       case 214:            /* umlaut-O -> Oe */
  3526.       case 216:            /* O-slash -> Oe */
  3527.         zdstuff('e');
  3528.         return('O');
  3529.       case 220:            /* umlaut-U -> Y */
  3530.         /* return('Y'); */
  3531.         zdstuff('e');
  3532.         return('U');
  3533.       case 228:            /* umlaut-a -> ae */
  3534.         zdstuff('e');
  3535.         return('a');
  3536.       case 246:            /* umlaut-o -> oe */
  3537.       case 248:            /* o-slash -> oe */
  3538.         zdstuff('e');
  3539.         return('o');
  3540.       case 252:            /* umlaut-u -> y */
  3541.         /* return('y'); */
  3542.         zdstuff('e');
  3543.         return('u');
  3544.       case 197:            /* A-ring -> Aa */
  3545.         zdstuff('a');
  3546.         return('A');
  3547.           case 229:            /* a-ring -> aa */
  3548.         zdstuff('a');
  3549.         return('a');
  3550.       default: return(yl1as[c]);    /* All others by the book */
  3551.     }
  3552.       default:
  3553.     return(yl1as[c]);        /* No language, go by the table. */
  3554.     }
  3555. }
  3556.  
  3557. CHAR                    /* IBM CP437 to Latin-1 */
  3558. #ifdef CK_ANSIC
  3559. x43l1(CHAR c)
  3560. #else
  3561. x43l1(c) CHAR c;
  3562. #endif /* CK_ANSIC */
  3563. { /* x43l1 */
  3564.     return(y43l1[c]);
  3565. }
  3566.  
  3567. CHAR                    /* IBM CP850 to Latin-1 */
  3568. #ifdef CK_ANSIC
  3569. x85l1(CHAR c)
  3570. #else
  3571. x85l1(c) CHAR c;
  3572. #endif /* CK_ANSIC */
  3573. { /* x85l1 */
  3574.     return(y85l1[c]);
  3575. }
  3576.  
  3577. CHAR                    /* Latin-1 to IBM CP437 */
  3578. #ifdef CK_ANSIC
  3579. xl143(CHAR c)
  3580. #else
  3581. xl143(c) CHAR c;
  3582. #endif /* CK_ANSIC */
  3583. { /* xl143 */
  3584.     return(yl143[c]);
  3585. }
  3586.  
  3587. CHAR                    /* Latin-1 to CP850 */
  3588. #ifdef CK_ANSIC
  3589. xl185(CHAR c)
  3590. #else
  3591. xl185(c) CHAR c;
  3592. #endif /* CK_ANSIC */
  3593. { /* xl185 */
  3594.     return(yl185[c]);
  3595. }
  3596.  
  3597. CHAR
  3598. #ifdef CK_ANSIC
  3599. x43as(CHAR c)
  3600. #else
  3601. x43as(c) CHAR c;
  3602. #endif /* CK_ANSIC */
  3603. { /* x43as */                /* CP437 to ASCII */
  3604.     c = y43l1[c];            /* Translate to Latin-1 */
  3605.     return(xl143(c));            /* and from Latin-1 to ASCII. */
  3606. }
  3607.  
  3608. CHAR
  3609. #ifdef CK_ANSIC
  3610. x85as(CHAR c)
  3611. #else
  3612. x85as(c) CHAR c;
  3613. #endif /* CK_ANSIC */
  3614. { /* x85as */                /* CP850 to ASCII */
  3615.     c = y85l1[c];            /* Translate to Latin-1 */
  3616.     return(xl1as(c));            /* and from Latin-1 to ASCII. */
  3617. }
  3618.  
  3619. CHAR                    /* Macintosh Latin to Latin-1 */
  3620. #ifdef CK_ANSIC
  3621. xaql1(CHAR c)
  3622. #else
  3623. xaql1(c) CHAR c;
  3624. #endif /* CK_ANSIC */
  3625. { /* xaql1 */
  3626.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  3627.     if (c == 206) {            /* handle OE digraph. */
  3628.         zmstuff('E');
  3629.         return('O');
  3630.     } else if (c == 207) {        /* Also lowercase oe. */
  3631.         zmstuff('e');
  3632.         return('o');
  3633.     }
  3634.     }
  3635.     return(yaql1[c]);
  3636. }
  3637.  
  3638. CHAR                    /* Macintosh Latin to ASCII */
  3639. #ifdef CK_ANSIC
  3640. xaqas(CHAR c)
  3641. #else
  3642. xaqas(c) CHAR c;
  3643. #endif /* CK_ANSIC */
  3644. { /* xaqas */
  3645.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  3646.     if (c == 206) {            /* handle OE digraph. */
  3647.         zmstuff('E');
  3648.         return('O');
  3649.     } else if (c == 207) {        /* Also lowercase oe. */
  3650.         zmstuff('e');
  3651.         return('o');
  3652.     }
  3653.     }
  3654.     c = yaql1[c];            /* Translate to Latin-1 */
  3655.     return(xl1as(c));            /* then to ASCII. */
  3656. }
  3657.  
  3658. CHAR                    /* Latin-1 to Macintosh Latin */
  3659. #ifdef CK_ANSIC
  3660. xl1aq(CHAR c)
  3661. #else
  3662. xl1aq(c) CHAR c;
  3663. #endif /* CK_ANSIC */
  3664. { /* xl1aq */
  3665.     return(yl1aq[c]);
  3666. }
  3667.  
  3668. #ifdef LATIN2
  3669.  
  3670. /* Translation functions for Latin Alphabet 2 */
  3671.  
  3672. CHAR                    /* Latin-2 to Latin-1 */
  3673. #ifdef CK_ANSIC
  3674. xl2l1(CHAR c)
  3675. #else
  3676. xl2l1(c) CHAR c;
  3677. #endif /* CK_ANSIC */
  3678. { /* xll2l1 */
  3679.     return(yl2l1[c]);
  3680. }
  3681.  
  3682. CHAR
  3683. #ifdef CK_ANSIC
  3684. xl2w1(CHAR c)
  3685. #else
  3686. xl2w1(c) CHAR c;
  3687. #endif /* CK_ANSIC */
  3688. { /* xl2w1 */                /* Latin-2 to CP1252 (Windows L1) */
  3689.     if (c > 127 && c < 160)
  3690.       return(UNK);
  3691.     else
  3692.       return(yl2l1[c]);
  3693. }
  3694.  
  3695. CHAR                    /* Latin-1 to Latin-2 */
  3696. #ifdef CK_ANSIC
  3697. xl1l2(CHAR c)
  3698. #else
  3699. xl1l2(c) CHAR c;
  3700. #endif /* CK_ANSIC */
  3701. { /* xll1l2 */
  3702.     return(yl1l2[c]);
  3703. }
  3704.  
  3705. CHAR                    /* CP1252 to Latin-1 */
  3706. #ifdef CK_ANSIC
  3707. xw1l2(CHAR c)
  3708. #else
  3709. xw1l2(c) CHAR c;
  3710. #endif /* CK_ANSIC */
  3711. { /* xw1l2 */
  3712.     switch (c) {
  3713.       case 0x8a: return(0xa9);        /* S caron */
  3714.       case 0x8e: return(0xae);        /* Z caron */
  3715.       case 0x9a: return(0xb9);        /* s caron */
  3716.       case 0x9e: return(0xbe);        /* z caron */
  3717.       default:
  3718.     return((c < 160) ? xw1as(c) : xl1l2(c));
  3719.     }
  3720. }
  3721.  
  3722.  
  3723. CHAR                    /* Latin-2 to ASCII */
  3724. #ifdef CK_ANSIC
  3725. xl2as(CHAR c)
  3726. #else
  3727. xl2as(c) CHAR c;
  3728. #endif /* CK_ANSIC */
  3729. { /* xll2as */
  3730.     return(yl2as[c]);
  3731. }
  3732.  
  3733. CHAR                    /* Latin-2 to CP852 */
  3734. #ifdef CK_ANSIC
  3735. xl252(CHAR c)
  3736. #else
  3737. xl252(c) CHAR c;
  3738. #endif /* CK_ANSIC */
  3739. { /* xll252 */
  3740.     return(yl252[c]);
  3741. }
  3742.  
  3743. CHAR                    /* Latin-2 to Mazovia */
  3744. #ifdef CK_ANSIC
  3745. xl2mz(CHAR c)
  3746. #else
  3747. xl2mz(c) CHAR c;
  3748. #endif /* CK_ANSIC */
  3749. { /* xll2mz */
  3750.     return(yl2mz[c]);
  3751. }
  3752.  
  3753. CHAR                    /* Latin-1 to Mazovia */
  3754. #ifdef CK_ANSIC
  3755. xl1mz(CHAR c)
  3756. #else
  3757. xl1mz(c) CHAR c;
  3758. #endif /* CK_ANSIC */
  3759. { /* xll1mz */
  3760.     return(yl2mz[yl1l2[c]]);
  3761. }
  3762.  
  3763. CHAR                    /* Mazovia to Latin-1 */
  3764. #ifdef CK_ANSIC
  3765. xmzl1(CHAR c)
  3766. #else
  3767. xmzl1(c) CHAR c;
  3768. #endif /* CK_ANSIC */
  3769. { /* xmzl1 */
  3770.     return(yl2l1[ymzl2[c]]);
  3771. }
  3772.  
  3773. CHAR                    /* Mazovia to Latin-9 */
  3774. #ifdef CK_ANSIC
  3775. xmzl9(CHAR c)
  3776. #else
  3777. xmzl9(c) CHAR c;
  3778. #endif /* CK_ANSIC */
  3779. { /* xmzl9 */
  3780.     return(xl2l9(ymzl2[c]));
  3781. }
  3782.  
  3783. CHAR                    /* CP852 to Latin-2 */
  3784. #ifdef CK_ANSIC
  3785. x52l2(CHAR c)
  3786. #else
  3787. x52l2(c) CHAR c;
  3788. #endif /* CK_ANSIC */
  3789. { /* x52l2 */
  3790.     return(y52l2[c]);
  3791. }
  3792.  
  3793. CHAR                    /* Mazovia to Latin-2 */
  3794. #ifdef CK_ANSIC
  3795. xmzl2(CHAR c)
  3796. #else
  3797. xmzl2(c) CHAR c;
  3798. #endif /* CK_ANSIC */
  3799. { /* xmzl2 */
  3800.     return(ymzl2[c]);
  3801. }
  3802.  
  3803. CHAR                    /* Latin-2 to CP1250 */
  3804. #ifdef CK_ANSIC
  3805. xl21250(CHAR c)
  3806. #else
  3807. xl21250(c) CHAR c;
  3808. #endif /* CK_ANSIC */
  3809. { /* xll21250 */
  3810.     return(yl21250[c]);
  3811. }
  3812.  
  3813. CHAR                    /* CP1250 to Latin-2 */
  3814. #ifdef CK_ANSIC
  3815. x1250l2(CHAR c)
  3816. #else
  3817. x1250l2(c) CHAR c;
  3818. #endif /* CK_ANSIC */
  3819. { /* x1250l2 */
  3820.     return(y1250l2[c]);
  3821. }
  3822.  
  3823. CHAR                    /* CP852 to ASCII */
  3824. #ifdef CK_ANSIC
  3825. x52as(CHAR c)
  3826. #else
  3827. x52as(c) CHAR c;
  3828. #endif /* CK_ANSIC */
  3829. { /* xl52as */
  3830.     return(yl2as[y52l2[c]]);        /* CP852 -> Latin-2 -> ASCII */
  3831. }
  3832.  
  3833. CHAR                    /* CP1250 to ASCII */
  3834. #ifdef CK_ANSIC
  3835. x1250as(CHAR c)
  3836. #else
  3837. x1250as(c) CHAR c;
  3838. #endif /* CK_ANSIC */
  3839. { /* xl1250as */
  3840.     return(yl2as[y1250l2[c]]);        /* CP81250 -> Latin-2 -> ASCII */
  3841. }
  3842.  
  3843.  
  3844. CHAR                    /* CP852 to Latin-1 */
  3845. #ifdef CK_ANSIC
  3846. x52l1(CHAR c)
  3847. #else
  3848. x52l1(c) CHAR c;
  3849. #endif /* CK_ANSIC */
  3850. { /* xl52l1 */
  3851.     return(yl2l1[y52l2[c]]);        /* CP852 -> Latin-2 -> Latin-1 */
  3852. }
  3853.  
  3854. CHAR                    /* CP1250 to Latin-1 */
  3855. #ifdef CK_ANSIC
  3856. x1250l1(CHAR c)
  3857. #else
  3858. x1250l1(c) CHAR c;
  3859. #endif /* CK_ANSIC */
  3860. { /* xl1250l1 */
  3861.     return(yl2l1[y1250l2[c]]);        /* CP1250 -> Latin-2 -> Latin-1 */
  3862. }
  3863.  
  3864. CHAR                    /* CP1250 to Latin-9 */
  3865. #ifdef CK_ANSIC
  3866. x1250l9(CHAR c)
  3867. #else
  3868. x1250l9(c) CHAR c;
  3869. #endif /* CK_ANSIC */
  3870. { /* x1250l9 */
  3871.     if (c == (CHAR)128)            /* Euro */
  3872.       return((CHAR)164);
  3873.     else
  3874.       return(xl2l9(y1250l2[c]));    /* CP1250 -> Latin-2 -> Latin-9 */
  3875. }
  3876.  
  3877. CHAR                    /* Latin-1 to CP852 */
  3878. #ifdef CK_ANSIC
  3879. xl152(CHAR c)
  3880. #else
  3881. xl152(c) CHAR c;
  3882. #endif /* CK_ANSIC */
  3883. { /* xll152 */
  3884.     return(yl252[yl1l2[c]]);        /* Latin-1 -> Latin-2 -> CP852 */
  3885. }
  3886.  
  3887. CHAR                    /* Latin-1 to CP1250 */
  3888. #ifdef CK_ANSIC
  3889. xl11250(CHAR c)
  3890. #else
  3891. xl11250(c) CHAR c;
  3892. #endif /* CK_ANSIC */
  3893. { /* xll11250 */
  3894.     return(yl21250[yl1l2[c]]);        /* Latin-1 -> Latin-2 -> CP1250 */
  3895. }
  3896.  
  3897. CHAR                    /* Latin-9 to CP1250 */
  3898. #ifdef CK_ANSIC
  3899. xl91250(CHAR c)
  3900. #else
  3901. xl91250(c) CHAR c;
  3902. #endif /* CK_ANSIC */
  3903. { /* xll91250 */
  3904.     if (c == (CHAR)164)            /* Euro */
  3905.       return((CHAR)128);
  3906.     else
  3907.       return(yl21250[xl9l2(c)]);    /* Latin-9 -> Latin-2 -> CP1250 */
  3908. }
  3909.  
  3910. CHAR                    /* Latin-9 to Mazovia */
  3911. #ifdef CK_ANSIC
  3912. xl9mz(CHAR c)
  3913. #else
  3914. xl9mz(c) CHAR c;
  3915. #endif /* CK_ANSIC */
  3916. { /* xll9mz */
  3917.     return(yl2mz[xl9l2(c)]);        /* Latin-9 -> Latin-2 -> Mazovia */
  3918. }
  3919.  
  3920. CHAR                    /* Latin-9 to Mazovia */
  3921. #ifdef CK_ANSIC
  3922. xmzas(CHAR c)
  3923. #else
  3924. xmzas(c) CHAR c;
  3925. #endif /* CK_ANSIC */
  3926. { /* xmzas */
  3927.     return(yl2as[xmzl2(c)]);        /* Mazovia -> Latin-2 -> ASCII */
  3928. }
  3929.  
  3930. CHAR                    /* Latin-2 to NeXT */
  3931. #ifdef CK_ANSIC
  3932. xl2ne(CHAR c)
  3933. #else
  3934. xl2ne(c) CHAR c;
  3935. #endif /* CK_ANSIC */
  3936. { /* xll2ne */
  3937.     switch(c) {
  3938.       case 162: return(198);        /* Breve */
  3939.       case 163: return(232);        /* L with stroke */
  3940.       case 178: return(206);        /* Ogonek */
  3941.       case 179: return(248);        /* l with stroke */
  3942.       case 183: return(207);        /* Caron */
  3943.       case 189: return(205);        /* Double acute */
  3944.       case 208: return(144);        /* D stroke = Eth */
  3945.       case 240: return(230);        /* d stroke = eth */
  3946.       case 255: return(199);        /* Dot above */
  3947.       default:  return(yl1ne[yl2l1[c]]);
  3948.     }
  3949. }
  3950.  
  3951. CHAR                    /* Latin-2 to CP437 */
  3952. #ifdef CK_ANSIC
  3953. xl243(CHAR c)
  3954. #else
  3955. xl243(c) CHAR c;
  3956. #endif /* CK_ANSIC */
  3957. { /* xll243 */
  3958.     return(yl1l2[y43l1[c]]);
  3959. }
  3960.  
  3961. CHAR                    /* Latin-2 to CP850 */
  3962. #ifdef CK_ANSIC
  3963. xl285(CHAR c)
  3964. #else
  3965. xl285(c) CHAR c;
  3966. #endif /* CK_ANSIC */
  3967. { /* xll285 */
  3968.     return(yl1l2[y85l1[c]]);
  3969. }
  3970.  
  3971. CHAR                    /* Latin-2 to Apple */
  3972. #ifdef CK_ANSIC
  3973. xl2aq(CHAR c)
  3974. #else
  3975. xl2aq(c) CHAR c;
  3976. #endif /* CK_ANSIC */
  3977. { /* xl2aq */
  3978.     return(yl1aq[yl2l1[c]]);        /* Could do more... */
  3979. }
  3980.  
  3981. CHAR                    /* Latin-2 to DGI */
  3982. #ifdef CK_ANSIC
  3983. xl2dg(CHAR c)
  3984. #else
  3985. xl2dg(c) CHAR c;
  3986. #endif /* CK_ANSIC */
  3987. { /* xll2dg */
  3988.     return(ydgl1[yl1l2[c]]);
  3989. }
  3990.  
  3991. CHAR                    /* Latin-2 to Short KOI */
  3992. #ifdef CK_ANSIC
  3993. xl2sk(CHAR c)
  3994. #else
  3995. xl2sk(c) CHAR c;
  3996. #endif /* CK_ANSIC */
  3997. { /* xll2sk */
  3998.     return(islower(c) ? toupper(c) : c);
  3999. }
  4000.  
  4001. CHAR                    /* NeXT to Latin-2 */
  4002. #ifdef CK_ANSIC
  4003. xnel2(CHAR c)
  4004. #else
  4005. xnel2(c) CHAR c;
  4006. #endif /* CK_ANSIC */
  4007. { /* xnel2 */
  4008.     switch (c) {
  4009.       case 144: return(208);        /* D stroke = Eth */
  4010.       case 198: return(162);        /* Breve */
  4011.       case 199: return(255);        /* Dot above */
  4012.       case 205: return(189);        /* Double acute */
  4013.       case 206: return(178);        /* Ogonek */
  4014.       case 207: return(183);        /* Caron */
  4015.       case 230: return(240);        /* d stroke = eth */
  4016.       case 232: return(163);        /* L with stroke */
  4017.       case 248: return(179);        /* l with stroke */
  4018.       default:  return(yl1l2[ynel1[c]]); /* Others, go thru Latin-1 */
  4019.     }
  4020. }
  4021.  
  4022. CHAR                    /* CP437 to Latin-2 */
  4023. #ifdef CK_ANSIC
  4024. x43l2(CHAR c)
  4025. #else
  4026. x43l2(c) CHAR c;
  4027. #endif /* CK_ANSIC */
  4028. { /* xl43l2 */
  4029.     return(yl1l2[y43l1[c]]);
  4030. }
  4031.  
  4032. CHAR                    /* CP850 to Latin-2 */
  4033. #ifdef CK_ANSIC
  4034. x85l2(CHAR c)
  4035. #else
  4036. x85l2(c) CHAR c;
  4037. #endif /* CK_ANSIC */
  4038. { /* xl85l2 */
  4039.     return(yl1l2[y85l1[c]]);
  4040. }
  4041.  
  4042. CHAR                    /* Apple to Latin-2 */
  4043. #ifdef CK_ANSIC
  4044. xaql2(CHAR c)
  4045. #else
  4046. xaql2(c) CHAR c;
  4047. #endif /* CK_ANSIC */
  4048. { /* xlaql2 */
  4049.     switch (c) {
  4050.       case 249: return(162);        /* Breve accent */
  4051.       case 250: return(255);        /* Dot accent */
  4052.       case 253: return(189);        /* Double acute */
  4053.       default: return(yl1l2[yaql1[c]]);
  4054.     }
  4055. }
  4056.  
  4057. CHAR                    /* DGI to Latin-2 */
  4058. #ifdef CK_ANSIC
  4059. xdgl2(CHAR c)
  4060. #else
  4061. xdgl2(c) CHAR c;
  4062. #endif /* CK_ANSIC */
  4063. { /* xldgl2 */
  4064.     return(yl1l2[ydgl1[c]]);        /* (for now) */
  4065. }
  4066.  
  4067. CHAR                    /* Short KOI to Latin-2 */
  4068. #ifdef CK_ANSIC
  4069. xskl2(CHAR c)
  4070. #else
  4071. xskl2(c) CHAR c;
  4072. #endif /* CK_ANSIC */
  4073. { /* xlskl2 */
  4074.     return(islower(c) ? toupper(c) : c);
  4075. }
  4076.  
  4077. CHAR                    /* Latin-2 to German */
  4078. #ifdef CK_ANSIC
  4079. xl2ge(CHAR c)
  4080. #else
  4081. xl2ge(c) CHAR c;
  4082. #endif /* CK_ANSIC */
  4083. { /* xll2ge */
  4084.     switch(c) {
  4085.       case 167: return(64);        /* Paragraph sign */
  4086.       case 196: return(91);        /* A-diaeresis */
  4087.       case 214: return(92);        /* O-diaeresis */
  4088.       case 220: return(93);        /* U-diaeresis */
  4089.       case 223: return(126);        /* double-s */
  4090.       case 228: return(123);        /* a-diaeresis */
  4091.       case 246: return(124);        /* o-diaeresis */
  4092.       case 252: return(125);        /* u-diaeresis */
  4093.       default:  return(yl2as[c]);    /* Others */
  4094.     }
  4095. }
  4096.  
  4097. CHAR                    /* German to Latin-2 */
  4098. #ifdef CK_ANSIC
  4099. xgel2(CHAR c)
  4100. #else
  4101. xgel2(c) CHAR c;
  4102. #endif /* CK_ANSIC */
  4103. { /* xlgel2 */
  4104.     if (c & 0x80)
  4105.       return(UNK);
  4106.     switch(c) {
  4107.       case 64:  return(167);        /* Paragraph sign */
  4108.       case 91:  return(196);        /* A-diaeresis */
  4109.       case 92:  return(214);        /* O-diaeresis */
  4110.       case 93:  return(220);        /* U-diaeresis */
  4111.       case 123: return(228);        /* a-diaeresis */
  4112.       case 126: return(223);        /* double-s */
  4113.       case 124: return(246);        /* o-diaeresis */
  4114.       case 125: return(252);        /* u-diaeresis */
  4115.       default:  return(c);        /* Others */
  4116.     }
  4117. }
  4118.  
  4119. CHAR                    /* Latin-2 to Hungarian */
  4120. #ifdef CK_ANSIC
  4121. xl2hu(CHAR c)
  4122. #else
  4123. xl2hu(c) CHAR c;
  4124. #endif /* CK_ANSIC */
  4125. { /* xll2hu */
  4126.     switch(c) {
  4127.       case 164: return(36);        /* Currency symbol */
  4128.       case 189: return(126);        /* Double acute accent */
  4129.       case 193: return(64);        /* A-acute */
  4130.       case 201: return(91);        /* E-acute */
  4131.       case 214: return(92);        /* O-diaeresis */
  4132.       case 220: return(93);        /* U-diaeresis */
  4133.       case 225: return(96);        /* a-acute */
  4134.       case 233: return(123);        /* e-acute */
  4135.       case 246: return(124);        /* o-diaeresis */
  4136.       case 252: return(125);        /* u-diaeresis */
  4137.       default:  return(yl2as[c]);    /* Others */
  4138.     }
  4139. }
  4140.  
  4141. CHAR                    /* Hungarian to Latin-2 */
  4142. #ifdef CK_ANSIC
  4143. xhul2(CHAR c)
  4144. #else
  4145. xhul2(c) CHAR c;
  4146. #endif /* CK_ANSIC */
  4147. { /* xlhul2 */
  4148.     if (c & 0x80)
  4149.       return(UNK);
  4150.     switch(c) {
  4151.       case 36:  return(164);        /* Currency symbol */
  4152.       case 64:  return(193);        /* A-acute */
  4153.       case 91:  return(201);        /* E-acute */
  4154.       case 92:  return(214);        /* O-diaeresis */
  4155.       case 93:  return(220);        /* U-diaeresis */
  4156.       case 96:  return(225);        /* a-acute */
  4157.       case 123: return(233);        /* e-acute */
  4158.       case 124: return(246);        /* o-diaeresis */
  4159.       case 125: return(252);        /* u-diaeresis */
  4160.       case 126: return(189);        /* Double acute accent */
  4161.       default:  return(c);        /* Others */
  4162.     }
  4163. }
  4164.  
  4165. CHAR
  4166. #ifdef CK_ANSIC
  4167. xr8l2(CHAR c)
  4168. #else
  4169. xr8l2(c) CHAR c;
  4170. #endif /* CK_ANSIC */
  4171. { /* xr8l2 */ /* Hewlett Packard Roman8 to Latin-2 */
  4172.     switch (c) {
  4173.       case 235: return(169);        /* S caron */
  4174.       case 236: return(185);        /* s caron */
  4175.       default:  return(yl1l2[yr8l1[c]]);
  4176.     }
  4177. }
  4178.  
  4179. CHAR
  4180. #ifdef CK_ANSIC
  4181. xl2r8(CHAR c)
  4182. #else
  4183. xl2r8(c) CHAR c;
  4184. #endif /* CK_ANSIC */
  4185. { /* xl2r8 */ /* Latin-2 to Hewlett Packard Roman8 Character Set */
  4186.     switch (c) {
  4187.       case 169: return(235);        /* S caron */
  4188.       case 185: return(236);        /* s caron */
  4189.       default:  return(yr8l1[yl1l2[c]]);
  4190.     }
  4191. }
  4192.  
  4193. #else /* NOLATIN2 */
  4194.  
  4195. #define xl1mz NULL
  4196. #define xmzl1 NULL
  4197. #define xl2mz NULL
  4198. #define xmzl2 NULL
  4199. #define xl9mz NULL
  4200. #define xmzl9 NULL
  4201. #define xmzas NULL
  4202.  
  4203. #define xl11250 NULL
  4204. #define xl21250 NULL
  4205. #define xl91250 NULL
  4206.  
  4207. #define x1250as NULL
  4208. #define x1250l1 NULL
  4209. #define x1250l2 NULL
  4210. #define x1250l9 NULL
  4211.  
  4212. #define xl2l1 NULL
  4213. #define xl2w1 NULL
  4214. #define xl1l2 NULL
  4215. #define xw1l2 NULL
  4216. #define xl2as NULL
  4217. #define xl252 NULL
  4218. #define x52l2 NULL
  4219. #define x52as NULL
  4220. #define x52l1 NULL
  4221. #define xl152 NULL
  4222. #define xl2ne NULL
  4223. #define xl243 NULL
  4224. #define xl285 NULL
  4225. #define xl2aq NULL
  4226. #define xl2dg NULL
  4227. #define xl2sk NULL
  4228. #define xnel2 NULL
  4229. #define x43l2 NULL
  4230. #define x85l2 NULL
  4231. #define xaql2 NULL
  4232. #define xdgl2 NULL
  4233. #define xskl2 NULL
  4234. #define xl2ge NULL
  4235. #define xgel2 NULL
  4236. #define xl2hu NULL
  4237. #define xhul2 NULL
  4238. #define xl2r8 NULL
  4239. #define xr8l2 NULL
  4240. #endif /* LATIN2 */
  4241.  
  4242. /* This one can also be used for ELOT 927, Hebrew 7, etc */
  4243.  
  4244. CHAR
  4245. #ifdef CK_ANSIC
  4246. xassk(CHAR c)
  4247. #else
  4248. xassk(c) CHAR c;
  4249. #endif /* CK_ANSIC */
  4250. { /* xassk */                /* ASCII to Short KOI */
  4251.     if (c & 0x80)
  4252.       return(UNK);
  4253.     return((c > 95) ? (c - 32) : c);    /* Fold columns 6-7 to 4-5 */
  4254. }
  4255.  
  4256. #ifdef CYRILLIC
  4257. /* Translation functions for Cyrillic character sets */
  4258.  
  4259. CHAR                    /* Latin/Cyrillic to CP866 */
  4260. #ifdef CK_ANSIC
  4261. xlcac(CHAR c)
  4262. #else
  4263. xlcac(c) CHAR c;
  4264. #endif /* CK_ANSIC */
  4265. { /* xlcac */                /* PC Code Page 866 */
  4266.     return(ylcac[c]);
  4267. }
  4268.  
  4269. CHAR                    /* Latin/Cyrillic to */
  4270. #ifdef CK_ANSIC
  4271. xlc55(CHAR c)
  4272. #else
  4273. xlc55(c) CHAR c;
  4274. #endif /* CK_ANSIC */
  4275. { /* xlc55 */                /* PC Code Page 855 */
  4276.     return(ylc55[c]);
  4277. }
  4278.  
  4279. CHAR                    /* Latin/Cyrillic to */
  4280. #ifdef CK_ANSIC
  4281. xlc1251(CHAR c)
  4282. #else
  4283. xlc1251(c) CHAR c;
  4284. #endif /* CK_ANSIC */
  4285. { /* xlc1251 */                /* PC Code Page 1251 */
  4286.     return(ylc1251[c]);
  4287. }
  4288.  
  4289. CHAR                    /* Latin/Cyrillic to... */
  4290. #ifdef CK_ANSIC
  4291. xlcbu(CHAR c)
  4292. #else
  4293. xlcbu(c) CHAR c;
  4294. #endif /* CK_ANSIC */
  4295. { /* xlcbu */                /* Bulgarian PC Code Page */
  4296.     return(ylcbu[c]);
  4297. }
  4298.  
  4299. CHAR                    /* Latin/Cyrillic to Old KOI-8 */
  4300. #ifdef CK_ANSIC
  4301. xlck8(CHAR c)
  4302. #else
  4303. xlck8(c) CHAR c;
  4304. #endif /* CK_ANSIC */
  4305. { /* xlck8 */
  4306.     return(ylck8[c]);
  4307. }
  4308.  
  4309. CHAR                    /* Latin/Cyrillic to KOI8-R */
  4310. #ifdef CK_ANSIC
  4311. xlckr(CHAR c)
  4312. #else
  4313. xlckr(c) CHAR c;
  4314. #endif /* CK_ANSIC */
  4315. { /* xlckr */
  4316.     switch(c) {
  4317.       case 0xa1: return(0xb3);        /* Io */
  4318.       case 0xf1: return(0xa3);        /* io */
  4319.       default:
  4320.     if (c > 0x7f && c < 0xc0)
  4321.       return(UNK);
  4322.     return(ylck8[c]);
  4323.     }
  4324. }
  4325.  
  4326. CHAR                    /* Latin/Cyrillic to  KOI8-U */
  4327. #ifdef CK_ANSIC
  4328. xlcku(CHAR c)
  4329. #else
  4330. xlcku(c) CHAR c;
  4331. #endif /* CK_ANSIC */
  4332. { /* xlcku */
  4333.     switch(c) {
  4334.       case 0xa1: return(0xb3);        /* Io */
  4335.       case 0xf1: return(0xa3);        /* io */
  4336.       case 0xf4: return(0xa4);        /* Ukrainian ie */
  4337.       case 0xf6: return(0xa6);        /* Ukrainian i */
  4338.       case 0xf7: return(0xa7);        /* Ukrainian yi */
  4339.       case 0xf3: return(0xad);        /* Ukrainian ghe with upturn */
  4340.       case 0xa4: return(0xb4);        /* Ukrainian Ie */
  4341.       case 0xa6: return(0xb6);        /* Ukrainian I */
  4342.       case 0xa7: return(0xb7);        /* Ukrainian Yi */
  4343.       case 0xa3: return(0xbd);        /* Ukrainian Ghe with upturn */
  4344.       default:
  4345.     if (c > 0x7f && c < 0xc0)
  4346.       return(UNK);
  4347.     return(ylck8[c]);
  4348.     }
  4349. }
  4350.  
  4351. CHAR
  4352. #ifdef CK_ANSIC
  4353. xlcsk(CHAR c)
  4354. #else
  4355. xlcsk(c) CHAR c;
  4356. #endif /* CK_ANSIC */
  4357. { /* xlcsk */                /* Latin/Cyrillic to Short KOI */
  4358.     return(ylcsk[c]);
  4359. }
  4360.  
  4361. CHAR
  4362. #ifdef CK_ANSIC
  4363. xlcas(CHAR c)
  4364. #else
  4365. xlcas(c) CHAR c;
  4366. #endif /* CK_ANSIC */
  4367. { /* xlcas */                /* Latin/Cyrillic to ASCII */
  4368.     if (langs[language].id == L_RUSSIAN)
  4369.       return(ylcsk[c]);
  4370.     else
  4371.       return((c > 127) ? '?' : c);
  4372. }
  4373.  
  4374. CHAR                    /* CP866 */
  4375. #ifdef CK_ANSIC
  4376. xaclc(CHAR c)
  4377. #else
  4378. xaclc(c) CHAR c;
  4379. #endif /* CK_ANSIC */
  4380. { /* xaclc */                /* to Latin/Cyrillic */
  4381.     return(yaclc[c]);
  4382. }
  4383.  
  4384. CHAR                    /* CP855 */
  4385. #ifdef CK_ANSIC
  4386. x55lc(CHAR c)
  4387. #else
  4388. x55lc(c) CHAR c;
  4389. #endif /* CK_ANSIC */
  4390. { /* x55lc */                /* to Latin/Cyrillic */
  4391.     return(y55lc[c]);
  4392. }
  4393.  
  4394. CHAR                    /* Bulgarian PC Code Page ... */
  4395. #ifdef CK_ANSIC
  4396. xbulc(CHAR c)
  4397. #else
  4398. xbulc(c) CHAR c;
  4399. #endif /* CK_ANSIC */
  4400. { /* xbulc */                /* to Latin/Cyrillic */
  4401.     return(ybulc[c]);
  4402. }
  4403.  
  4404. CHAR                    /* CP1251 */
  4405. #ifdef CK_ANSIC
  4406. x1251lc(CHAR c)
  4407. #else
  4408. x1251lc(c) CHAR c;
  4409. #endif /* CK_ANSIC */
  4410. { /* x1251lc */                /* to Latin/Cyrillic */
  4411.     return(y1251lc[c]);
  4412. }
  4413.  
  4414. CHAR                    /* Old KOI-8 to Latin/Cyrillic */
  4415. #ifdef CK_ANSIC
  4416. xk8lc(CHAR c)
  4417. #else
  4418. xk8lc(c) CHAR c;
  4419. #endif /* CK_ANSIC */
  4420. { /* xk8lc */
  4421.     return(yk8lc[c]);
  4422. }
  4423.  
  4424. CHAR                    /* KOI8-R to Latin/Cyrillic */
  4425. #ifdef CK_ANSIC
  4426. xkrlc(CHAR c)
  4427. #else
  4428. xkrlc(c) CHAR c;
  4429. #endif /* CK_ANSIC */
  4430. { /* xkrlc */
  4431.     if (c == 0xb3) return(0xa1);
  4432.     else if (c == 0xa3) return(0xf1);
  4433.     else if (c > 0x7f && c < 0xc0)
  4434.       return(UNK);
  4435.     return(yk8lc[c]);
  4436. }
  4437.  
  4438. CHAR                    /* KOI8-U to Latin/Cyrillic */
  4439. #ifdef CK_ANSIC
  4440. xkulc(CHAR c)
  4441. #else
  4442. xkulc(c) CHAR c;
  4443. #endif /* CK_ANSIC */
  4444. { /* xkulc */
  4445.     switch (c) {
  4446.       case 0xb3: return(0xa1);        /* Io */
  4447.       case 0xa3: return(0xf1);        /* io */
  4448.       case 0xa4: return(0xf4);        /* Ukrainian ie */
  4449.       case 0xa6: return(0xf6);        /* Ukrainian i */
  4450.       case 0xa7: return(0xf7);        /* Ukrainian yi */
  4451.       case 0xad: return(0xf3);        /* Ukrainian ghe with upturn */
  4452.       case 0xb4: return(0xa4);        /* Ukrainian Ie */
  4453.       case 0xb6: return(0xa6);        /* Ukrainian I */
  4454.       case 0xb7: return(0xa7);        /* Ukrainian Yi */
  4455.       case 0xbd: return(0xa3);        /* Ukrainian Ghe with upturn */
  4456.       /* Note substitution of Gje for Ghe-Upturn, which is not in 8859-5 */
  4457.       default:
  4458.     if (c > 0x7f && c < 0xc0)
  4459.       return(UNK);
  4460.     return(yk8lc[c]);
  4461.     }
  4462. }
  4463.  
  4464. CHAR
  4465. #ifdef CK_ANSIC
  4466. xskcy(CHAR c)
  4467. #else
  4468. xskcy(c) CHAR c;
  4469. #endif /* CK_ANSIC */
  4470. { /* xskcy */            /* Short KOI to Latin/Cyrillic */
  4471.     return(yskcy[c & 0x7f]);
  4472. }
  4473.  
  4474. CHAR
  4475. #ifdef CK_ANSIC
  4476. xascy(CHAR c)
  4477. #else
  4478. xascy(c) CHAR c;
  4479. #endif /* CK_ANSIC */
  4480. { /* xascy */            /* ASCII to Latin/Cyrillic */
  4481.     if (langs[language].id == L_RUSSIAN) { /* If LANGUAGE == RUSSIAN  */
  4482.     return(yskcy[c & 0x7f]);    /* treat ASCII as Short KOI */
  4483.     } else return((c > 127) ? '?' : c);
  4484. }
  4485.  
  4486. CHAR
  4487. #ifdef CK_ANSIC
  4488. xacas(CHAR c)
  4489. #else
  4490. xacas(c) CHAR c;
  4491. #endif /* CK_ANSIC */
  4492. { /* xacas */            /* CP866 to ASCII */
  4493.     if (langs[language].id == L_RUSSIAN) {
  4494.     c = yaclc[c];            /* First to Latin/Cyrillic */
  4495.     return(ylcsk[c]);        /* Then to Short KOI */
  4496.     } else return((c > 127) ? '?' : c);
  4497. }
  4498.  
  4499. CHAR
  4500. #ifdef CK_ANSIC
  4501. x55as(CHAR c)
  4502. #else
  4503. x55as(c) CHAR c;
  4504. #endif /* CK_ANSIC */
  4505. { /* x55as */            /* CP855 to ASCII */
  4506.     if (langs[language].id == L_RUSSIAN) {
  4507.     c = y55lc[c];            /* First to Latin/Cyrillic */
  4508.     return(ylcsk[c]);        /* Then to Short KOI */
  4509.     } else return((c > 127) ? '?' : c);
  4510. }
  4511.  
  4512. CHAR
  4513. #ifdef CK_ANSIC
  4514. x1251as(CHAR c)
  4515. #else
  4516. x1251as(c) CHAR c;
  4517. #endif /* CK_ANSIC */
  4518. { /* x1251as */            /* CP81251 to ASCII */
  4519.     if (langs[language].id == L_RUSSIAN) {
  4520.     c = y1251lc[c];            /* First to Latin/Cyrillic */
  4521.     return(ylcsk[c]);        /* Then to Short KOI */
  4522.     } else return((c > 127) ? '?' : c);
  4523. }
  4524.  
  4525. CHAR
  4526. #ifdef CK_ANSIC
  4527. xskas(CHAR c)
  4528. #else
  4529. xskas(c) CHAR c;
  4530. #endif /* CK_ANSIC */
  4531. { /* xskas */                /* Short KOI to ASCII */
  4532.     return((c > 95) ? '?' : c);
  4533. }
  4534.  
  4535. CHAR
  4536. #ifdef CK_ANSIC
  4537. xk8as(CHAR c)
  4538. #else
  4539. xk8as(c) CHAR c;
  4540. #endif /* CK_ANSIC */
  4541. { /* xk8as */                /* Old KOI-8 Cyrillic to ASCII */
  4542.     if (langs[language].id == L_RUSSIAN) {
  4543.     c = yk8lc[c];            /* First to Latin/Cyrillic */
  4544.     return(ylcsk[c]);        /* Then to Short KOI */
  4545.     } else return((c > 127) ? '?' : c);
  4546. }
  4547.  
  4548. CHAR
  4549. #ifdef CK_ANSIC
  4550. xl1sk(CHAR c)
  4551. #else
  4552. xl1sk(c) CHAR c;
  4553. #endif /* CK_ANSIC */
  4554. { /* xl1sk */                /* Latin-1 to Short KOI */
  4555.     c = zl1as(c);            /* Convert to ASCII */
  4556.     return(c = xassk(c));        /* Convert ASCII to Short KOI */
  4557. }
  4558.  
  4559. CHAR
  4560. #ifdef CK_ANSIC
  4561. xw1lc(CHAR c)
  4562. #else
  4563. xw1lc(c) CHAR c;
  4564. #endif /* CK_ANSIC */
  4565. { /* xw1lc */                /* CP1252 to Latin/Cyrillic */
  4566.     return((c < 160) ? xw1as(c) : zl1as(c));
  4567. }
  4568.  
  4569. CHAR
  4570. #ifdef CK_ANSIC
  4571. xaslc(CHAR c)
  4572. #else
  4573. xaslc(c) CHAR c;
  4574. #endif /* CK_ANSIC */
  4575. { /* xaslc */            /* ASCII to Latin/Cyrillic */
  4576.     if (langs[language].id == L_RUSSIAN)
  4577.       return(yskcy[c & 0x7f]);
  4578.     else return(c & 0x7f);
  4579. }
  4580.  
  4581. CHAR
  4582. #ifdef CK_ANSIC
  4583. xasac(CHAR c)
  4584. #else
  4585. xasac(c) CHAR c;
  4586. #endif /* CK_ANSIC */
  4587. { /* xasac */            /* ASCII to CP866 */
  4588.     if (c & 0x80)
  4589.       return(UNK);
  4590.     if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  4591.     c = xskcy(c);            /* Translate to Latin/Cyrillic */
  4592.     return(ylcac[c]);        /* Then to CP866 */
  4593.     } else return(c & 0x7f);
  4594. }
  4595.  
  4596. CHAR
  4597. #ifdef CK_ANSIC
  4598. xas55(CHAR c)
  4599. #else
  4600. xas55(c) CHAR c;
  4601. #endif /* CK_ANSIC */
  4602. { /* xas55 */            /* ASCII to CP855 */
  4603.     if (c & 0x80)
  4604.       return(UNK);
  4605.     if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  4606.     c = xskcy(c);            /* Translate to Latin/Cyrillic */
  4607.     return(ylc55[c]);        /* Then to CP866 */
  4608.     } else return(c & 0x7f);
  4609. }
  4610.  
  4611. CHAR
  4612. #ifdef CK_ANSIC
  4613. xas1251(CHAR c)
  4614. #else
  4615. xas1251(c) CHAR c;
  4616. #endif /* CK_ANSIC */
  4617. { /* xas1251 */            /* ASCII to CP81251 */
  4618.     if (c & 0x80)
  4619.       return(UNK);
  4620.     if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  4621.     c = xskcy(c);            /* Translate to Latin/Cyrillic */
  4622.     return(ylc1251[c]);        /* Then to CP866 */
  4623.     } else return(c & 0x7f);
  4624. }
  4625.  
  4626. CHAR
  4627. #ifdef CK_ANSIC
  4628. xask8(CHAR c)
  4629. #else
  4630. xask8(c) CHAR c;
  4631. #endif /* CK_ANSIC */
  4632. { /* xask8 */            /* ASCII to KOI-8 */
  4633.     if (c & 0x80)
  4634.       return(UNK);
  4635.     if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  4636.     c = xskcy(c);            /* Translate to Latin/Cyrillic */
  4637.     return(ylck8[c]);        /* Then to KOI-8 */
  4638.     } else return(c & 0x7f);
  4639. }
  4640. #else /* No Cyrillic */
  4641. #define xacas NULL
  4642. #define x55as NULL
  4643. #define x1251as NULL
  4644. #define xaclc NULL
  4645. #define x55lc NULL
  4646. #define x1251lc NULL
  4647. #define xasac NULL
  4648. #define xas55 NULL
  4649. #define xas1251 NULL
  4650. #define xascy NULL
  4651. #define xask8 NULL
  4652. #define xaslc NULL
  4653. #define xassk NULL
  4654. #define xk8as NULL
  4655. #define xk8lc NULL
  4656. #define xkrlc NULL
  4657. #define xkulc NULL
  4658. #define xl1sk NULL
  4659. #define xw1lc NULL
  4660. #define xlcac NULL
  4661. #define xlc55 NULL
  4662. #define xlc1251 NULL
  4663. #define xlcas NULL
  4664. #define xlck8 NULL
  4665. #define xlckr NULL
  4666. #define xlcku NULL
  4667. #define xlch7 NULL
  4668. #define xlcsk NULL
  4669. #define xskas NULL
  4670. #define xskcy NULL
  4671. #define xbulc NULL
  4672. #define xlcbu NULL
  4673. #endif /* CYRILLIC */
  4674.  
  4675. /* Translation functions for Hebrew character sets */
  4676.  
  4677. #ifdef HEBREW
  4678.  
  4679. CHAR
  4680. #ifdef CK_ANSIC
  4681. xash7(CHAR c)
  4682. #else
  4683. xash7(c) CHAR c;
  4684. #endif /* CK_ANSIC */
  4685. { /* xash7 */            /* ASCII to Hebrew-7 */
  4686.     if (c & 0x80)
  4687.       return(UNK);
  4688.     if (c == 96) return('?');
  4689.     if (c > 96 && c < 123) return(c - 32);
  4690.     else return(c);
  4691. }
  4692.  
  4693. CHAR
  4694. #ifdef CK_ANSIC
  4695. xl1h7(CHAR c)
  4696. #else
  4697. xl1h7(c) CHAR c;
  4698. #endif /* CK_ANSIC */
  4699. { /* xl1h7 */            /* Latin-1 to Hebrew-7 */
  4700.     return(xash7(xl1as(c)));
  4701. }
  4702.  
  4703. CHAR
  4704. #ifdef CK_ANSIC
  4705. xl1lh(CHAR c)
  4706. #else
  4707. xl1lh(c) CHAR c;
  4708. #endif /* CK_ANSIC */
  4709. { /* xl1lh */                /* Latin-1 to Latin/Hebrew */
  4710.     switch(c) {
  4711.       case 170: return('a');        /* Feminine ordinal */
  4712.       case 186: return('o');        /* Masculine ordinal */
  4713.       case 215: return(170);        /* Times */
  4714.       case 247: return(186);        /* Divide */
  4715.       default:  return( (c > 190) ? xl1as(c) : c );
  4716.     }
  4717. }
  4718.  
  4719. CHAR
  4720. #ifdef CK_ANSIC
  4721. xw1lh(CHAR c)
  4722. #else
  4723. xw1lh(c) CHAR c;
  4724. #endif /* CK_ANSIC */
  4725. { /* xw1lh */                /* CP1252 to Latin/Hebrew */
  4726.     switch(c) {
  4727.       case 170: return('a');        /* Feminine ordinal */
  4728.       case 186: return('o');        /* Masculine ordinal */
  4729.       case 215: return(170);        /* Times */
  4730.       case 247: return(186);        /* Divide */
  4731.       default:
  4732.     if (c < 160)
  4733.       return(xw1as(c));
  4734.     else
  4735.       return((c > 190) ? xl1as(c) : c);
  4736.     }
  4737. }
  4738.  
  4739. #ifdef LATIN2
  4740. CHAR
  4741. #ifdef CK_ANSIC
  4742. xl2h7(CHAR c)
  4743. #else
  4744. xl2h7(c) CHAR c;
  4745. #endif /* CK_ANSIC */
  4746. { /* xl2h7 */                /* Latin-2 to Hebrew-7 */
  4747.     return(xash7(xl2as(c)));
  4748. }
  4749. #else
  4750. #define xl2h7 NULL
  4751. #endif /* LATIN2 */
  4752.  
  4753. #ifndef NOCYRIL
  4754. CHAR
  4755. #ifdef CK_ANSIC
  4756. xlch7(CHAR c)
  4757. #else
  4758. xlch7(c) CHAR c;
  4759. #endif /* CK_ANSIC */
  4760. { /* xlch7 */                /* Latin/Cyrillic to Hebrew-7 */
  4761.     return(xash7(xlcas(c)));
  4762. }
  4763. #endif /* NOCYRIL */
  4764.  
  4765. CHAR
  4766. #ifdef CK_ANSIC
  4767. xlhas(CHAR c)
  4768. #else
  4769. xlhas(c) CHAR c;
  4770. #endif /* CK_ANSIC */
  4771. { /* xlhas */            /* Latin/Hebrew to ASCII */
  4772.     return( (c > 127) ? '?' : c );
  4773. }
  4774.  
  4775. CHAR
  4776. #ifdef CK_ANSIC
  4777. xlhl1(CHAR c)
  4778. #else
  4779. xlhl1(c) CHAR c;
  4780. #endif /* CK_ANSIC */
  4781. { /* xlhl1 */            /* Latin/Hebrew to Latin-1 */
  4782.     switch (c) {
  4783.       case 170: return(215);
  4784.       case 186: return(247);
  4785.       default: return( (c > 190) ? '?' : c );
  4786.     }
  4787. }
  4788.  
  4789. CHAR
  4790. #ifdef CK_ANSIC
  4791. xlhw1(CHAR c)
  4792. #else
  4793. xlhw1(c) CHAR c;
  4794. #endif /* CK_ANSIC */
  4795. { /* xlhw1 */            /* Latin/Hebrew to CP1252 */
  4796.     if (c > 127 && c < 160)
  4797.       return('?');
  4798.     switch (c) {
  4799.       case 170: return(215);
  4800.       case 186: return(247);
  4801.       default: return( (c > 190) ? '?' : c );
  4802.     }
  4803. }
  4804.  
  4805. CHAR
  4806. #ifdef CK_ANSIC
  4807. xlh62(CHAR c)
  4808. #else
  4809. xlh62(c) CHAR c;
  4810. #endif /* CK_ANSIC */
  4811. { /* xlh62 */            /* Latin/Hebrew to CP862 */
  4812.     return(ylh62[c]);
  4813. }
  4814.  
  4815. CHAR
  4816. #ifdef CK_ANSIC
  4817. xl162(CHAR c)
  4818. #else
  4819. xl162(c) CHAR c;
  4820. #endif /* CK_ANSIC */
  4821. { /* xl162 */            /* Latin-1 to CP862 */
  4822.     return(xlh62(xl1lh(c)));    /* Via Latin/Hebrew */
  4823. }
  4824.  
  4825. CHAR
  4826. #ifdef CK_ANSIC
  4827. xlhh7(CHAR c)
  4828. #else
  4829. xlhh7(c) CHAR c;
  4830. #endif /* CK_ANSIC */
  4831. { /* xlhh7 */            /* Latin/Hebrew to Hebrew-7 */
  4832.     return(ylhh7[c]);
  4833. }
  4834.  
  4835. CHAR
  4836. #ifdef CK_ANSIC
  4837. xh7as(CHAR c)
  4838. #else
  4839. xh7as(c) CHAR c;
  4840. #endif /* CK_ANSIC */
  4841. { /* xh7as */            /* Hebrew-7 to ASCII */
  4842.     if (c & 0x80)
  4843.       return(UNK);
  4844.     return( (c > 95 && c < 123) ? '?' : c );
  4845. }
  4846.  
  4847. CHAR
  4848. #ifdef CK_ANSIC
  4849. x62lh(CHAR c)
  4850. #else
  4851. x62lh(c) CHAR c;
  4852. #endif /* CK_ANSIC */
  4853. { /* x62lh */            /* CP862 to Latin/Hebrew */
  4854.     return(y62lh[c]);
  4855. }
  4856.  
  4857. CHAR
  4858. #ifdef CK_ANSIC
  4859. x62as(CHAR c)
  4860. #else
  4861. x62as(c) CHAR c;
  4862. #endif /* CK_ANSIC */
  4863. { /* x62as */            /* CP862 to ASCII */
  4864.     return( xlhas(x62lh(c)) );
  4865. }
  4866.  
  4867. CHAR
  4868. #ifdef CK_ANSIC
  4869. x62l1(CHAR c)
  4870. #else
  4871. x62l1(c) CHAR c;
  4872. #endif /* CK_ANSIC */
  4873. { /* x62l1 */            /* CP862 to Latin-1 */
  4874.     return( xlhl1(x62lh(c)) );
  4875. }
  4876.  
  4877. CHAR
  4878. #ifdef CK_ANSIC
  4879. xh7lh(CHAR c)
  4880. #else
  4881. xh7lh(c) CHAR c;
  4882. #endif /* CK_ANSIC */
  4883. { /* xh7lh */            /* Hebrew-7 to Latin/Hebrew */
  4884.     if (c & 0x80)
  4885.       return(UNK);
  4886.     return(yh7lh[c]);
  4887. }
  4888.  
  4889. #else /* No Hebrew */
  4890.  
  4891. #define xash7 NULL
  4892. #define xl1h7 NULL
  4893. #define xl2h7 NULL
  4894. #define xlch7 NULL
  4895. #define xl1lh NULL
  4896. #define xw1lh NULL
  4897. #define xlhas NULL
  4898. #define xlhl1 NULL
  4899. #define xlhw1 NULL
  4900. #define xl162 NULL
  4901. #define xlhh7 NULL
  4902. #define xlh62 NULL
  4903. #define xh7as NULL
  4904. #define x62as NULL
  4905. #define x62l1 NULL
  4906. #define xh7lh NULL
  4907. #define x62lh NULL
  4908.  
  4909. #endif /* HEBREW */
  4910.  
  4911. /* Translation functions for Greek character sets */
  4912.  
  4913. #ifdef GREEK
  4914.  
  4915. CHAR
  4916. #ifdef CK_ANSIC
  4917. xaseg(CHAR c)
  4918. #else
  4919. xaseg(c) CHAR c;
  4920. #endif /* CK_ANSIC */
  4921. { /* xaseg */            /* ASCII to ELOT 927 */
  4922.     if (c & 0x80)
  4923.       return(UNK);
  4924.     if (c > 96 && c < 123) return(c - 32);
  4925.     else return(c);
  4926. }
  4927.  
  4928. CHAR
  4929. #ifdef CK_ANSIC
  4930. xl1eg(CHAR c)
  4931. #else
  4932. xl1eg(c) CHAR c;
  4933. #endif /* CK_ANSIC */
  4934. { /* xl1ge */            /* Latin-1 to ELOT 927 */
  4935.     return(xaseg(xl1as(c)));
  4936. }
  4937.  
  4938. CHAR
  4939. #ifdef CK_ANSIC
  4940. xl2lg(CHAR c)
  4941. #else
  4942. xl2lg(c) CHAR c;
  4943. #endif /* CK_ANSIC */
  4944. { /* xl2lg */            /* Latin-1 to Latin/Greek */
  4945.     if (c < 160) return(c);
  4946.     else if (c == 160 || c == 168 || c == 173 || c == 174)
  4947.       return(c);
  4948.     else return('?');
  4949. }
  4950.  
  4951. CHAR
  4952. #ifdef CK_ANSIC
  4953. xl1lg(CHAR c)
  4954. #else
  4955. xl1lg(c) CHAR c;
  4956. #endif /* CK_ANSIC */
  4957. { /* xl1lg */            /* Latin-1 to Latin/Greek */
  4958.     if (c < 160) return(c);
  4959.     switch(c) {
  4960.       case 160:                /* Themselves */
  4961.       case 164:
  4962.       case 166:
  4963.       case 167:
  4964.       case 168:
  4965.       case 169:
  4966.       case 171:
  4967.       case 172:
  4968.       case 173:
  4969.       case 176:
  4970.       case 177:
  4971.       case 178:
  4972.       case 179:
  4973.       case 180:
  4974.       case 187:
  4975.       case 189:
  4976.     return(c);
  4977.       case 181:                /* Lowercase mu */
  4978.     return(236);
  4979.       default:
  4980.     return(UNK);
  4981.     }
  4982. }
  4983.  
  4984. CHAR
  4985. #ifdef CK_ANSIC
  4986. xw1lg(CHAR c)
  4987. #else
  4988. xw1lg(c) CHAR c;
  4989. #endif /* CK_ANSIC */
  4990. { /* xw1lg */                /* CP1252 to Latin/Greek */
  4991.     return((c < 160) ? xw1as(c) : xl1lg(c));
  4992. }
  4993.  
  4994.  
  4995. #ifdef LATIN2
  4996. CHAR
  4997. #ifdef CK_ANSIC
  4998. xl2eg(CHAR c)
  4999. #else
  5000. xl2eg(c) CHAR c;
  5001. #endif /* CK_ANSIC */
  5002. { /* xl2eg */                /* Latin-2 to ELOT 927 */
  5003.     return(xaseg(xl2as(c)));
  5004. }
  5005. #else
  5006. #define xl2eg NULL
  5007. #endif /* LATIN2 */
  5008.  
  5009. #ifndef NOCYRIL
  5010. CHAR
  5011. #ifdef CK_ANSIC
  5012. xlceg(CHAR c)
  5013. #else
  5014. xlceg(c) CHAR c;
  5015. #endif /* CK_ANSIC */
  5016. { /* xlceg */            /* Latin/Cyrillic to ELOT 927 */
  5017.     return(xaseg(xlcas(c)));
  5018. }
  5019. #endif /* NOCYRIL */
  5020.  
  5021. CHAR
  5022. #ifdef CK_ANSIC
  5023. xlgas(CHAR c)
  5024. #else
  5025. xlgas(c) CHAR c;
  5026. #endif /* CK_ANSIC */
  5027. { /* xlgas */            /* Latin/Greek to ASCII */
  5028.     return( (c > 127) ? '?' : c );
  5029. }
  5030.  
  5031. CHAR
  5032. #ifdef CK_ANSIC
  5033. xlgl1(CHAR c)
  5034. #else
  5035. xlgl1(c) CHAR c;
  5036. #endif /* CK_ANSIC */
  5037. { /* xlgl1 */            /* Latin/Greek to Latin-1 */
  5038.     if (c == 236)
  5039.       return(181);
  5040.     else
  5041.       return(xl1lg(c));
  5042. }
  5043.  
  5044. CHAR
  5045. #ifdef CK_ANSIC
  5046. xlgw1(CHAR c)
  5047. #else
  5048. xlgw1(c) CHAR c;
  5049. #endif /* CK_ANSIC */
  5050. { /* xlgw1 */            /* Latin/Greek to Latin-1 */
  5051.     if (c > 127 && c < 160)
  5052.       return('?');
  5053.     return(xlgl1(c));
  5054. }
  5055.  
  5056. CHAR
  5057. #ifdef CK_ANSIC
  5058. xlg69(CHAR c)
  5059. #else
  5060. xlg69(c) CHAR c;
  5061. #endif /* CK_ANSIC */
  5062. { /* xlg69 */            /* Latin/Greek to CP869 */
  5063.     return(ylg69[c]);
  5064. }
  5065.  
  5066. CHAR
  5067. #ifdef CK_ANSIC
  5068. xl169(CHAR c)
  5069. #else
  5070. xl169(c) CHAR c;
  5071. #endif /* CK_ANSIC */
  5072. { /* xl169 */            /* Latin-1 to CP869 */
  5073.     return(xlg69(xl1lg(c)));    /* Via Latin/Greek */
  5074. }
  5075.  
  5076. CHAR
  5077. #ifdef CK_ANSIC
  5078. xlgeg(CHAR c)
  5079. #else
  5080. xlgeg(c) CHAR c;
  5081. #endif /* CK_ANSIC */
  5082. { /* xlgeg */            /* Latin/Greek to ELOT 927 */
  5083.     return(ylgeg[c]);
  5084. }
  5085.  
  5086. CHAR
  5087. #ifdef CK_ANSIC
  5088. xegas(CHAR c)
  5089. #else
  5090. xegas(c) CHAR c;
  5091. #endif /* CK_ANSIC */
  5092. { /* xegas */            /* ELOT 927 to ASCII */
  5093.     if (c & 0x80)
  5094.       return(UNK);
  5095.     return( (c > 96 && c < 123) ? '?' : c );
  5096. }
  5097.  
  5098. CHAR
  5099. #ifdef CK_ANSIC
  5100. x69lg(CHAR c)
  5101. #else
  5102. x69lg(c) CHAR c;
  5103. #endif /* CK_ANSIC */
  5104. { /* x69lg */            /* CP869 to Latin/Greek */
  5105.     return(y69lg[c]);
  5106. }
  5107.  
  5108. CHAR
  5109. #ifdef CK_ANSIC
  5110. x69as(CHAR c)
  5111. #else
  5112. x69as(c) CHAR c;
  5113. #endif /* CK_ANSIC */
  5114. { /* x69as */            /* CP869 to ASCII */
  5115.     return( xlgas(x69lg(c)) );
  5116. }
  5117.  
  5118. CHAR
  5119. #ifdef CK_ANSIC
  5120. x69l1(CHAR c)
  5121. #else
  5122. x69l1(c) CHAR c;
  5123. #endif /* CK_ANSIC */
  5124. { /* x69l1 */            /* CP869 to Latin-1 */
  5125.     return( xlgl1(x69lg(c)) );
  5126. }
  5127.  
  5128. CHAR
  5129. #ifdef CK_ANSIC
  5130. xeglg(CHAR c)
  5131. #else
  5132. xeglg(c) CHAR c;
  5133. #endif /* CK_ANSIC */
  5134. { /* xeglg */            /* ELOT 927 to Latin/Greek */
  5135.     return(yeglg[c]);
  5136. }
  5137.  
  5138. #else /* No Greek */
  5139.  
  5140. #define x69as NULL
  5141. #define x69l1 NULL
  5142. #define x69lg NULL
  5143. #define xaseg NULL
  5144. #define xegas NULL
  5145. #define xeglg NULL
  5146. #define xl169 NULL
  5147. #define xl1eg NULL
  5148. #define xl1lg NULL
  5149. #define xw1lg NULL
  5150. #define xl2ge NULL
  5151. #define xl2lg NULL
  5152. #define xlcge NULL
  5153. #define xlg69 NULL
  5154. #define xlgas NULL
  5155. #define xlgeg NULL
  5156. #define xlgge NULL
  5157. #define xlgl1 NULL
  5158. #define xlgw1 NULL
  5159.  
  5160. #endif /* GREEK */
  5161.  
  5162.  
  5163. /* Translation functions for Japanese Kanji character sets */
  5164.  
  5165. #ifdef KANJI
  5166. /*
  5167.   Translate Kanji Transfer Character Set (EUC) to local file character set,
  5168.   contributed by Dr. Hirofumi Fujii, Japan High Energy Research Laboratory
  5169.   (KEK), Tokyo, Japan.
  5170.  
  5171.   a is a byte to be translated, which may be a single-byte character,
  5172.   the Katakana prefix, the first byte of a two-byte Kanji character, or the
  5173.   second byte of 2-byte Kanji character.
  5174.  
  5175.   fn is the output function.
  5176.  
  5177.   Returns 0 on success, -1 on failure.
  5178. */
  5179.  
  5180. _PROTOTYP(static int jpnxas, (int, int[]) );
  5181. _PROTOTYP(static int jpnxkt, (int, int[]) );
  5182. _PROTOTYP(static int jpnxkn, (int[], int[]) );
  5183.  
  5184. static int jpncnt;            /* Byte count for Japanese */
  5185. static int jpnlst;            /* Last status (for JIS7) */
  5186.  
  5187. static int
  5188. jpnxas(a, obuf) int a; int obuf[]; { /* Translate ASCII to local file code */
  5189.     int r;
  5190.  
  5191.     r = 0;
  5192.     if (fcharset == FC_JIS7) {
  5193.     switch (jpnlst) {
  5194.       case 1:
  5195.         obuf[0] = 0x0f;
  5196.         obuf[1] = a;
  5197.         r = 2;
  5198.         break;
  5199.       case 2:
  5200.         obuf[0] = 0x1b;
  5201.         obuf[1] = 0x28;
  5202.         obuf[2] = 0x4a;
  5203.         obuf[3] = a;
  5204.         r = 4;
  5205.         break;
  5206.       default:
  5207.         obuf[0] = a;
  5208.         r = 1;
  5209.         break;
  5210.     }
  5211.     } else {
  5212.     obuf[0] = a;
  5213.     r = 1;
  5214.     }
  5215.     return(r);
  5216. }
  5217.  
  5218. static int
  5219. jpnxkt(a, obuf) int a; int obuf[]; {
  5220. /* Translate JIS X 201 Katakana to local code */
  5221.  
  5222.     int r;
  5223.  
  5224.     r = 0;
  5225.     if (fcharset == FC_JIS7) {
  5226.     switch (jpnlst) {
  5227.       case 2:                /* from Kanji */
  5228.         obuf[r++] = 0x1b;
  5229.         obuf[r++] = 0x28;
  5230.         obuf[r++] = 0x4a;
  5231.       case 0:                /* from Roman */
  5232.         obuf[r++] = 0x0e;
  5233.       default:
  5234.         obuf[r++] = (a & 0x7f);
  5235.       break;
  5236.     }
  5237.     } else {
  5238.     if (fcharset == FC_JEUC)
  5239.       obuf[r++] = 0x8e;
  5240.     obuf[r++] = (a | 0x80);
  5241.     }
  5242.     return(r);
  5243. }
  5244.  
  5245. static int
  5246. jpnxkn(ibuf, obuf) int ibuf[], obuf[]; {
  5247.     /* Translate JIS X 0208 Kanji to local code */
  5248.     int c1, c2;
  5249.     int r;
  5250.  
  5251.     c1 = ibuf[0] & 0x7f;
  5252.     c2 = ibuf[1] & 0x7f;
  5253.  
  5254.     if (fcharset == FC_SHJIS) {
  5255.     if (c1 & 1)
  5256.       c2 += 0x1f;
  5257.     else
  5258.       c2 += 0x7d;
  5259.  
  5260.         if (c2 >= 0x7f) c2++;
  5261.  
  5262.         c1 = ((c1 - 0x21) >> 1) + 0x81;
  5263.         if (c1 > 0x9f) c1 += 0x40;
  5264.  
  5265.         obuf[0] = c1;
  5266.         obuf[1] = c2;
  5267.         r = 2;
  5268.     } else if (fcharset == FC_JIS7) {
  5269.         r = 0;
  5270.         switch (jpnlst) {
  5271.         case 1:
  5272.         obuf[r++] = 0x0f; /* From Katakana */
  5273.         case 0:
  5274.         obuf[r++] = 0x1b;
  5275.         obuf[r++] = 0x24;
  5276.         obuf[r++] = 0x42;
  5277.       default:
  5278.         obuf[r++] = c1;
  5279.         obuf[r++] = c2;
  5280.         break;
  5281.     }
  5282.     } else {
  5283.         obuf[0] = (c1 | 0x80);
  5284.         obuf[1] = (c2 | 0x80);
  5285.         r = 2;
  5286.     }
  5287.     return(r);
  5288. }
  5289.  
  5290. int
  5291. xkanjf() {
  5292. /* Initialize parameters for xkanji */
  5293. /* This function should be called when F/X-packet is received */
  5294.     jpncnt = jpnlst = 0;
  5295.     return(0);
  5296. }
  5297.  
  5298. int
  5299. #ifdef CK_ANSIC
  5300. xkanjz(int (*fn)(char))
  5301. #else
  5302. xkanjz(fn) int (*fn)();
  5303. #endif /* CK_ANSIC */
  5304. { /* xkanjz */
  5305. /*
  5306.   Terminate xkanji
  5307.   This function must be called when Z-packet is received
  5308.   (before closing the file).
  5309. */
  5310.     static int obuf[6];
  5311.     int r, i, c;
  5312.  
  5313.     if (fcharset == FC_JIS7) {
  5314.         c = 'A';            /* Dummy Roman character */
  5315.         r = jpnxas(c, obuf) - 1;    /* -1 removes Dummy character */
  5316.         if (r > 0) {
  5317.         for (i = 0; i < r; i++)
  5318.           if (((*fn)((char) obuf[i])) < 0)
  5319.         return(-1);
  5320.     }
  5321.     }
  5322.     return(0);
  5323. }
  5324.  
  5325. int
  5326. #ifdef CK_ANSIC
  5327. xkanji(int a, int (*fn)(char))
  5328. #else
  5329. xkanji(a, fn) int a; int (*fn)();
  5330. #endif /* CK_ANSIC */
  5331. { /* xkanji */
  5332.     static int xbuf[2];
  5333.     static int obuf[8];
  5334.  
  5335.     int i, r;
  5336.     int c7;
  5337.     int state=0;
  5338.  
  5339.     r = 0;
  5340.     if (jpncnt == 0) {
  5341.     /* 1st byte */
  5342.     if ((a & 0x80) == 0) {
  5343.         /* 8th bit is 0, i.e., single-byte code */
  5344.         r = jpnxas(a, obuf);
  5345.         state = 0;
  5346.     } else {
  5347.         /* 8th bit is 1, check the range */
  5348.         c7 = a & 0x7f;
  5349.         if (((c7 > 0x20) && (c7 < 0x7f)) || (c7 == 0x0e)) {
  5350.             /* double byte code */
  5351.             xbuf[jpncnt++] = a;
  5352.         } else {
  5353.             /* single byte code */
  5354.             r = jpnxas(a, obuf);
  5355.             state = 0;
  5356.         }
  5357.     }
  5358.     } else {
  5359.     /* not the 1st byte */
  5360.     xbuf[jpncnt++] = a;
  5361.     if (xbuf[0] == 0x8e) {
  5362.         r = jpnxkt(xbuf[1], obuf);
  5363.         state = 1;
  5364.     } else {
  5365.         r = jpnxkn(xbuf, obuf);
  5366.         state = 2;
  5367.     }
  5368.     }
  5369.     if (r > 0) {
  5370.         for (i = 0; i < r; i++ )
  5371.       if (((*fn)((char) obuf[i])) < 0)
  5372.         return(-1);
  5373.         jpnlst = state;
  5374.         jpncnt = 0;
  5375.     }
  5376.     return(0);
  5377. }
  5378.  
  5379. /*
  5380.   Function for translating from Japanese file character set
  5381.   to Japanese EUC transfer character set.
  5382.   Returns a pointer to a string containing 0, 1, or 2 bytes.
  5383. */
  5384.  
  5385. /* zkanji */
  5386. static int jpnstz;            /* status for JIS-7 */
  5387. static int jpnpnd;            /* number of pending bytes */
  5388. static int jpnpnt;            /* pending buffer index */
  5389. static int jpnpbf[8];            /* pending buffer */
  5390.  
  5391. /* There is some duplication here between the old and new JIS-7 parsers */
  5392. /* to be cleaned up later... */
  5393.  
  5394. VOID
  5395. j7init() {                /* Initialize JIS-7 parser */
  5396.     jpnstz = 0;
  5397.     jpnpnd = 0;
  5398.     jpnpnt = 0;
  5399. }
  5400.  
  5401. int
  5402. getj7() {                /* Reads JIS-7 returns next EUC byte */
  5403.     int x;
  5404.  
  5405.     if (jpnpnd > 0) {            /* If something is pending */
  5406.     x = (unsigned) jpnpbf[jpnpnt++]; /* Get it */
  5407.     jpnpnd--;
  5408.     if (jpnpnd < 0) jpnpnd = 0;
  5409.     return((unsigned)x);
  5410.     }
  5411.     jpnpnt = 0;
  5412.  
  5413.     if ((x = zminchar()) < 0) return(x);
  5414.     while (jpnpnd == 0) {        /* While something is pending... */
  5415.     if ((x > 0x20) && (x < 0x7f)) {    /* 7-bit graphic character */
  5416.         switch (jpnstz) {
  5417.           case 1:             /* Katakana */
  5418. #ifdef COMMENT
  5419.         /* This can't be right... */
  5420.         jpnpbf[jpnpnd++] = 0x80; /* Insert flag (NOT SS2???) */
  5421. #else
  5422.         jpnpbf[jpnpnd++] = 0x8e; /* Insert SS2 */
  5423. #endif /* COMMENT */
  5424.         jpnpbf[jpnpnd++] = (x | 0x80); /* Insert Kana + 8th bit */
  5425.         break;
  5426.           case 2:            /* Kanji */
  5427.         jpnpbf[jpnpnd++] = (x | 0x80); /* Get another byte */
  5428.         if ((x = zminchar()) < 0) return(x);
  5429.         jpnpbf[jpnpnd++] = (x | 0x80);
  5430.         break;
  5431.           default:            /* ASCII / JIS Roman */
  5432.         jpnpbf[jpnpnd++] = x;
  5433.         break;
  5434.         }
  5435.     } else if (x == 0x0e) {        /* ^N = SO */
  5436.         jpnstz = 1;            /* Katakana */
  5437.         if ((x = zminchar()) < 0) return(x);
  5438.     } else if (x == 0x0f) {        /* ^O = SI */
  5439.         jpnstz = 0;            /* ASCII / JIS Roman */
  5440.         if ((x = zminchar()) < 0) return(x);
  5441.     } else if (x == 0x1b) {        /* Escape */
  5442.         jpnpbf[jpnpnd++] = x;    /* Save in buffer */
  5443.         if ((x = zminchar()) < 0) return(x);
  5444.         jpnpbf[jpnpnd++] = x;    /* Save in buffer */
  5445.         if (x == '$') {        /* <ESC>$ */
  5446.         if ((x = zminchar()) < 0) return(x);
  5447.         jpnpbf[jpnpnd++] = x;
  5448.         if ((x == '@') || (x == 'B')) {    /* Kanji */
  5449.             jpnstz = 2;
  5450.             jpnpnt = jpnpnd = 0;
  5451.             if ((x = zminchar()) < 0) return(x);
  5452.         }
  5453.         } else if (x == '(') {    /* <ESC>( == 94-byte single-byte set */
  5454.         if ((x = zminchar()) < 0) return(x);
  5455.         jpnpbf[jpnpnd++] = x;
  5456.         if ((x == 'B') || (x == 'J')) {    /* ASCII or JIS Roman */
  5457.             jpnstz = 0;                /* Set state */
  5458.             jpnpnt = jpnpnd = 0;        /* Reset pointers */
  5459.             if ((x = zminchar()) < 0) return(x);
  5460.         }
  5461.         } else if (x == 0x1b) {    /* <ESC><ESC> */
  5462.         jpnpnt = jpnpnd = 0;    /* Reset pointers, stay in state */
  5463.         if ((x = zminchar()) < 0) return(x);
  5464.         }
  5465.     } else {            /* Not <ESC> - just save it */
  5466.         jpnpbf[jpnpnd++] = x;
  5467.     }
  5468.     }
  5469.     jpnpnt = 0;
  5470.     x = (unsigned)jpnpbf[jpnpnt++];
  5471.     jpnpnd--;
  5472.     return((unsigned)x);
  5473. }
  5474.  
  5475. USHORT
  5476. #ifdef CK_ANSIC
  5477. eu_to_sj(USHORT eu)            /* EUC-JP to Shift-JIS */
  5478. #else
  5479. eu_to_sj(eu) USHORT eu;
  5480. #endif /* CK_ANSIC */
  5481. {
  5482.     int c1, c2;
  5483.     union ck_short jcode,scode;
  5484.  
  5485.     jcode.x_short = eu;
  5486.     c1 = (jcode.x_char[byteorder] & 0x7f);
  5487.     c2 = (jcode.x_char[1-byteorder] & 0x7f);
  5488.  
  5489.     if (c1 & 1)
  5490.       c2 += 0x1f;
  5491.     else
  5492.       c2 += 0x7d;
  5493.     if (c2 >= 0x7f)
  5494.       c2++;
  5495.     c1 = ((c1 - 0x21) >> 1) + 0x81;
  5496.     if (c1 > 0x9f)
  5497.       c1 += 0x40;
  5498.  
  5499.     scode.x_char[byteorder] = c1;
  5500.     scode.x_char[1-byteorder] = c2;
  5501.     return(scode.x_short);
  5502. }
  5503.  
  5504.  
  5505. USHORT
  5506. #ifdef CK_ANSIC
  5507. sj_to_eu(USHORT sj)            /* Shift-JIS to EUC-JP */
  5508. #else
  5509. sj_to_eu(sj) USHORT sj;
  5510. #endif /* CK_ANSIC */
  5511. {
  5512.     union ck_short jcode, scode;
  5513.     int c0, c1;
  5514.  
  5515.     scode.x_short = sj;
  5516.     c0 = scode.x_char[byteorder];    /* Left (hi order) byte */
  5517.     c1 = scode.x_char[1-byteorder];    /* Right (lo order) byte */
  5518.  
  5519.     if (((c0 >= 0x81) && (c0 <= 0x9f)) || /* High order byte has 8th bit set */
  5520.         ((c0 >= 0xe0) && (c0 <= 0xfc))) { /* Kanji */
  5521.     if (c0 <= 0x9f)              /* Two bytes in */
  5522.       c0 -= 0x71;              /* Do the shifting... */
  5523.     else
  5524.       c0 -= 0xb1;
  5525.     c0 = c0 * 2 + 1;
  5526.     if (c1 > 0x7f) c1 -= 1;
  5527.     if (c1 >= 0x9e) {
  5528.         c1 -= 0x7d;
  5529.         c0 += 1;
  5530.     } else {
  5531.         c1 -= 0x1f;
  5532.     }
  5533.     jcode.x_char[byteorder] = (c0 | 0x80); /* Two bytes out */
  5534.     jcode.x_char[1-byteorder] = (c1 | 0x80);
  5535.  
  5536.     } else if (c0 == 0) {        /* Single byte */
  5537.     if (c1 >= 0xa1 && c1 <= 0xdf) {    /* Katakana */
  5538.         jcode.x_char[byteorder] = 0x8e; /* SS2 */
  5539.         jcode.x_char[1-byteorder] = c1; /* Kana code */
  5540.     } else {            /* ASCII or C0 */
  5541.         jcode.x_short = c1;
  5542.     }
  5543.     } else {                /* Something bad */
  5544.     debug(F001,"sj_to_eu bad sj","",sj);
  5545.     jcode.x_short = 0xffff;
  5546.     }
  5547.     return(jcode.x_short);
  5548. }
  5549.  
  5550. int
  5551. zkanjf() {                /* Initialize */
  5552.     jpnstz = jpnpnd = jpnpnt = 0;
  5553.     return(0);
  5554. }
  5555.  
  5556. int
  5557. zkanjz() {
  5558.     return(0);
  5559. }
  5560.  
  5561. int
  5562. #ifdef CK_ANSIC
  5563. zkanji(int (*fn)(void))
  5564. #else
  5565. zkanji(fn) int (*fn)();
  5566. #endif /* CK_ANSIC */
  5567. { /* zkanji */
  5568.     /* Read Japanese local code and translate to Japanese EUC */
  5569.     int a;
  5570.     int sc[3];
  5571.  
  5572.     /* No pending characters */
  5573.     if (fcharset == FC_SHJIS) {        /* Translating from Shift-JIS */
  5574.         if (jpnpnd) {
  5575.             jpnpnd--;
  5576.             return(jpnpbf[jpnpnt++]);
  5577.         }
  5578.         a = (*fn)();
  5579.     jpnpnd = jpnpnt = 0;
  5580.     if (((a >= 0x81) && (a <= 0x9f)) ||
  5581.         ((a >= 0xe0) && (a <= 0xfc))) { /* 2-byte Kanji code */
  5582.         sc[0] = a;
  5583.         if ((sc[1] = (*fn)()) < 0)    /* Get second byte */
  5584.           return(sc[1]);
  5585.         if (sc[0] <= 0x9f)
  5586.           sc[0] -= 0x71;
  5587.         else
  5588.           sc[0] -= 0xb1;
  5589.         sc[0] = sc[0] * 2 + 1;
  5590.         if (sc[1] > 0x7f)
  5591.           sc[1]--;
  5592.         if (sc[1] >= 0x9e) {
  5593.             sc[1] -= 0x7d;
  5594.             sc[0]++;
  5595.         } else {
  5596.             sc[1] -= 0x1f;
  5597.         }
  5598.         a = (sc[0] | 0x80);
  5599.         jpnpbf[0] = (sc[1] | 0x80);
  5600.         jpnpnd = 1;
  5601.         jpnpnt = 0;
  5602.     } else if ((a >= 0xa1) && (a <= 0xdf)) { /* Katakana */
  5603.         jpnpbf[0] = a;
  5604.         jpnpnd = 1;
  5605.         jpnpnt = 0;
  5606.         a = 0x8e;
  5607.     }
  5608.     return(a);
  5609.     } else if (fcharset == FC_JIS7 ) {    /* 7-bit JIS X 0208 */
  5610.         if (jpnpnd) {
  5611.             a = jpnpbf[jpnpnt++];
  5612.         jpnpnd--;
  5613.             return(a);
  5614.         }
  5615.         jpnpnt = 0;
  5616.         if ((a = (*fn)()) < 0)
  5617.       return(a);
  5618.         while (jpnpnd == 0) {
  5619.             if ((a > 0x20) && (a < 0x7f)) {
  5620.                 switch (jpnstz) {
  5621.           case 1:
  5622.             jpnpbf[jpnpnd++] = 0x80; /* Katakana */
  5623.             jpnpbf[jpnpnd++] = (a | 0x80);
  5624.             break;
  5625.           case 2:
  5626.             jpnpbf[jpnpnd++] = (a | 0x80); /* Kanji */
  5627.             if ((a = (*fn)()) < 0)
  5628.               return(a);
  5629.             jpnpbf[jpnpnd++] = (a | 0x80);
  5630.             break;
  5631.           default:
  5632.             jpnpbf[jpnpnd++] = a; /* Single byte */
  5633.             break;
  5634.                 }
  5635.             } else if (a == 0x0e) {
  5636.                 jpnstz = 1;
  5637.                 if ((a = (*fn)()) < 0)
  5638.           return(a);
  5639.             } else if (a == 0x0f) {
  5640.                 jpnstz = 0;
  5641.                 if ((a = (*fn)()) < 0)
  5642.           return(a);
  5643.             } else if (a == 0x1b) {
  5644.                 jpnpbf[jpnpnd++] = a;    /* Escape */
  5645.                 if ((a = (*fn)()) < 0)
  5646.           return(a);
  5647.                 jpnpbf[jpnpnd++] = a;
  5648.                 if (a == '$') {
  5649.                     if ((a = (*fn)()) < 0)
  5650.               return(a);
  5651.                     jpnpbf[jpnpnd++] = a;
  5652.                     if ((a == '@') || (a == 'B')) {
  5653.                         jpnstz = 2;
  5654.             jpnpnt = jpnpnd = 0;
  5655.                         if ((a = (*fn)()) < 0)
  5656.               return(a);
  5657.                     }
  5658.                 } else if (a == '(') {
  5659.                     if ((a = (*fn)()) < 0)
  5660.               return(a);
  5661.                     jpnpbf[jpnpnd++] = a;
  5662.                     if ((a == 'B') || (a == 'J')) {
  5663.                         jpnstz = 0;
  5664.             jpnpnt = jpnpnd = 0;
  5665.                         if ((a = (*fn)()) < 0)
  5666.               return(a);
  5667.                     }
  5668.                 } else if (a == 0x1b) {
  5669.                     jpnpnt = jpnpnd = 0;
  5670.                     if ((a = (*fn)()) < 0)
  5671.               return(a);
  5672.                 }
  5673.             } else {
  5674.                 jpnpbf[jpnpnd++] = a;
  5675.             }
  5676.         }
  5677.         jpnpnt = 0;
  5678.         a = jpnpbf[jpnpnt++];
  5679.     jpnpnd--;
  5680.         return(a);
  5681.     } else {
  5682.         a = (*fn)();
  5683.         return(a);
  5684.     }
  5685. }
  5686. #endif /* KANJI */
  5687.  
  5688. /* Euro functions */
  5689.  
  5690. #ifdef LATIN2
  5691. CHAR
  5692. #ifdef CK_ANSIC
  5693. xl2l9(CHAR c)
  5694. #else
  5695. xl2l9(c) CHAR c;
  5696. #endif /* CK_ANSIC */
  5697. { /* xl2l9 */                 /* Latin-2 to Latin-9... */
  5698.     switch (c) {
  5699.       case 169: return((CHAR)166);    /* S caron */
  5700.       case 185: return((CHAR)168);    /* s caron */
  5701.       case 174: return((CHAR)180);    /* Z caron */
  5702.       case 190: return((CHAR)184);    /* z caron */
  5703.       default:
  5704.     return(yl2l1[c]);
  5705.     }
  5706.  
  5707. }
  5708.  
  5709. _PROTOTYP( CHAR xl258, ( CHAR ) );
  5710. CHAR
  5711. #ifdef CK_ANSIC
  5712. xl258(CHAR c)
  5713. #else
  5714. xl258(c) CHAR c;
  5715. #endif /* CK_ANSIC */
  5716. { /* xl258 */                 /* Latin-2 to CP858... */
  5717.     return(c);
  5718. }
  5719. #else
  5720. #define xl2l9 NULL
  5721. #define xl258 NULL
  5722. #endif /* LATIN2 */
  5723.  
  5724. CHAR
  5725. #ifdef CK_ANSIC
  5726. zl9as(CHAR c)
  5727. #else
  5728. zl9as(c) CHAR c;
  5729. #endif /* CK_ANSIC */
  5730. { /* zl9as */                 /* Latin-9 to US ASCII... */
  5731.     if (c < (CHAR)0x80) return(c);    /* Save a function call */
  5732.     switch (c) {
  5733.       case 0xa4: return(UNK);        /* Euro */
  5734.       case 0xa6: return('S');        /* S Caron */
  5735.       case 0xa8: return('s');        /* s Caron */
  5736.       case 0xb4: return('Z');        /* Z Caron */
  5737.       case 0xbc: return('O');        /* OE digraph */
  5738.       case 0xbd: return('o');        /* oe digraph */
  5739.       case 0xbe: return('Y');        /* Y diaeresis */
  5740.       default:   return(zl1as(c));    /* The rest is like Latin-1 */
  5741.     }
  5742. }
  5743.  
  5744. _PROTOTYP( CHAR xl9as, ( CHAR ) );
  5745. CHAR
  5746. #ifdef CK_ANSIC
  5747. xl9as(CHAR c)
  5748. #else
  5749. xl9as(c) CHAR c;
  5750. #endif /* CK_ANSIC */
  5751. { /* xl9as */                 /* Latin-9 to US ASCII... */
  5752.     if (c < (CHAR)0x80) return(c);    /* Save a function call */
  5753.     switch (c) {
  5754.       case 0xa4: return(UNK);        /* Euro */
  5755.       case 0xa6: return('S');        /* S Caron */
  5756.       case 0xa8: return('s');        /* s Caron */
  5757.       case 0xb4: return('Z');        /* Z Caron */
  5758.       case 0xb8: return('z');        /* z Caron */
  5759.       case 0xbc: return('O');        /* OE digraph */
  5760.       case 0xbd: return('o');        /* oe digraph */
  5761.       case 0xbe: return('Y');        /* Y diaeresis */
  5762.       default:   return(xl1as(c));    /* The rest is like Latin-1 */
  5763.     }
  5764. }
  5765.  
  5766. CHAR                    /* CP1252 to Latin-9 */
  5767. #ifdef CK_ANSIC
  5768. xw1l9(CHAR c)
  5769. #else
  5770. xw1l9(c) CHAR c;
  5771. #endif /* CK_ANSIC */
  5772. { /* xw1l9 */
  5773.     switch (c) {
  5774.       case 0x80: return(0xa4);        /* Euro sign */
  5775.       case 0x8a: return(0xa6);        /* S caron */
  5776.       case 0x8c: return(0xbc);        /* OE */
  5777.       case 0x8e: return(0xb4);        /* Z caron */
  5778.       case 0x9a: return(0xa8);        /* s caron */
  5779.       case 0x9c: return(0xbd);        /* oe */
  5780.       case 0x9e: return(0xb8);        /* z caron */
  5781.       case 0x9f: return(0xbe);        /* Y diaeresis */
  5782.       case 0xa4:            /* Currency sign */
  5783.       case 0xa6:            /* Broken vertical bar */
  5784.       case 0xa8:            /* Diaeresis */
  5785.       case 0xb4:            /* Acute accent */
  5786.       case 0xb8:            /* Cedilla */
  5787.       case 0xbc:            /* 1/4 */
  5788.       case 0xbd:            /* 1/2 */
  5789.       case 0xbe: return('?');        /* 3/4 */
  5790.       default: return((c < 160) ? xw1as(c) : c);
  5791.     }
  5792. }
  5793.  
  5794. #ifdef LATIN2
  5795. CHAR
  5796. #ifdef CK_ANSIC
  5797. xl9l2(CHAR c)
  5798. #else
  5799. xl9l2(c) CHAR c;
  5800. #endif /* CK_ANSIC */
  5801. { /* xl9l2 */                 /* Latin-9 to Latin-2... */
  5802.     if (c < (CHAR)0x80) return(c);    /* Save a function call */
  5803.     switch (c) {
  5804.       case 0xa4: return(UNK);        /* Euro */
  5805.       case 0xa6: return((CHAR)0xa9);    /* S Caron */
  5806.       case 0xa8: return((CHAR)0xb9);    /* s Caron */
  5807.       case 0xb4: return((CHAR)0xae);    /* Z Caron */
  5808.       case 0xb8: return((CHAR)0xaf);    /* z Caron */
  5809.       case 0xbc: return('O');        /* OE digraph */
  5810.       case 0xbd: return('o');        /* oe digraph */
  5811.       case 0xbe: return('Y');        /* Y diaeresis */
  5812.       default:   return(xl1l2(c));    /* The rest is like Latin-1 */
  5813.     }
  5814. }
  5815. #else
  5816. #define xl9l2 NULL
  5817. #endif /* LATIN2 */
  5818.  
  5819. CHAR
  5820. #ifdef CK_ANSIC
  5821. xl958(CHAR c)
  5822. #else
  5823. xl958(c) CHAR c;
  5824. #endif /* CK_ANSIC */
  5825. { /* xl958 */                 /* Latin-9 to CP858... */
  5826.     if (c == 0xa4)            /* Euro Symbol */
  5827.       return((CHAR)0xd5);
  5828.     else if (c == 0x9e)            /* This was currency symbol */
  5829.       return((CHAR)0xcf);
  5830.     c = yl185[c];
  5831.     return(c);
  5832. }
  5833.  
  5834. CHAR
  5835. #ifdef CK_ANSIC
  5836. x58as(CHAR c)
  5837. #else
  5838. x58as(c) CHAR c;
  5839. #endif /* CK_ANSIC */
  5840. { /* x58as */                 /* CP858 to US ASCII... */
  5841.     if (c == 0xd5)            /* Euro rather than dotless i */
  5842.       return(UNK);
  5843.     else
  5844.       return(x85as(c));            /* The rest is like CP850 */
  5845. }
  5846.  
  5847. CHAR
  5848. #ifdef CK_ANSIC
  5849. x58l1(CHAR c)
  5850. #else
  5851. x58l1(c) CHAR c;
  5852. #endif /* CK_ANSIC */
  5853. { /* x58l1 */                 /* CP858 to Latin-1... */
  5854.     if (c == 0xd5)            /* Euro rather than dotless i */
  5855.       return((CHAR)0xa4);        /* Return currency symbol */
  5856.     else if (c == 0xcf)            /* This keeps it invertible */
  5857.       return((CHAR)0x9e);
  5858.     else
  5859.       return(x85l1(c));
  5860. }
  5861.  
  5862. #ifdef LATIN2
  5863. CHAR
  5864. #ifdef CK_ANSIC
  5865. x58l2(CHAR c)
  5866. #else
  5867. x58l2(c) CHAR c;
  5868. #endif /* CK_ANSIC */
  5869. { /* x58l2 */                 /* CP858 to Latin-2... */
  5870.     if (c == 0xd5)            /* Euro rather than dotless i */
  5871.       return((CHAR)0xa4);        /* Return currency symbol */
  5872.     else if (c == 0xcf)            /* This keeps it invertible */
  5873.       return((CHAR)0x9e);        /* (if it ever was...) */
  5874.     else                /* Otherwise like CP850 */
  5875.       return(x85l2(c));
  5876. }
  5877. #else
  5878. #define x58l2 NULL
  5879. #endif /* LATIN2 */
  5880.  
  5881. CHAR
  5882. #ifdef CK_ANSIC
  5883. x58l9(CHAR c)
  5884. #else
  5885. x58l9(c) CHAR c;
  5886. #endif /* CK_ANSIC */
  5887. { /* x58l9 */                 /* CP-858 to Latin-9... */
  5888.     if (c == 0xd5)            /* Euro rather than dotless i */
  5889.       return((CHAR)0xa4);        /* Return currency symbol */
  5890.     else if (c == 0xcf)            /* This keeps it invertible */
  5891.       return((CHAR)0x9e);        /* (if it ever was...) */
  5892.     else                /* Otherwise like CP850 */
  5893.       return(x85l1(c));            /* to Latin-1 */
  5894. }
  5895.  
  5896. /* End Euro functions */
  5897.  
  5898.  
  5899. /*  TABLES OF TRANSLATION FUNCTIONS */
  5900.  
  5901. /*
  5902.   First, the table of translation functions for RECEIVING files.  That is,
  5903.   *from* the TRANSFER character set *to* the FILE character set, an array of
  5904.   pointers to functions.  The first index is the TRANSFER CHARACTER-SET
  5905.   number, the second index is the FILE CHARACTER-SET number.
  5906.  
  5907.   These arrays must be fully populated, even if (as is the case with Kanji
  5908.   character sets), all the entries are NULL.  Otherwise, subscript
  5909.   calculations will be wrong and we'll use the wrong functions.
  5910. */
  5911.  
  5912. /* Pointers to byte-for-byte translation functions */
  5913.  
  5914. _PROTOTYP( CHAR (*rx), (CHAR) );
  5915. _PROTOTYP( CHAR (*sx), (CHAR) );
  5916.  
  5917. #ifdef UNICODE
  5918. _PROTOTYP( int (*xut), (USHORT) );    /* Translation function UCS to TCS */
  5919. _PROTOTYP( int (*xuf), (USHORT) );    /* Translation function UCS to FCS */
  5920. _PROTOTYP( USHORT (*xtu), (CHAR) );    /* Translation function TCS to UCS */
  5921. _PROTOTYP( USHORT (*xfu), (CHAR) );    /* Translation function FCS to UCS */
  5922. #endif /* UNICODE */
  5923.  
  5924. #ifdef CK_ANSIC
  5925. CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])(CHAR) =
  5926. #else
  5927. CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])() =
  5928. #endif /* CK_ANSIC */
  5929. {
  5930.     NULL,            /* 0,0 transparent to us ascii */
  5931.     NULL,            /* 0,1 transparent to uk ascii */
  5932.     NULL,            /* 0,2 transparent to dutch nrc */
  5933.     NULL,            /* 0,3 transparent to finnish nrc */
  5934.     NULL,            /* 0,4 transparent to french nrc */
  5935.     NULL,            /* 0,5 transparent to fr-canadian nrc */
  5936.     NULL,            /* 0,6 transparent to german nrc */
  5937.     NULL,            /* 0,7 transparent to hungarian nrc */
  5938.     NULL,            /* 0,8 transparent to italian nrc */
  5939.     NULL,            /* 0,9 transparent to norge/danish nrc */
  5940.     NULL,            /* 0,10 transparent to portuguese nrc */
  5941.     NULL,            /* 0,11 transparent to spanish nrc */
  5942.     NULL,            /* 0,12 transparent to swedish nrc */
  5943.     NULL,            /* 0,13 transparent to swiss nrc */
  5944.     NULL,            /* 0,14 transparent to latin-1 */
  5945.     NULL,            /* 0,15 transparent to latin-2 */
  5946.     NULL,            /* 0,16 transparent to DEC MCS */
  5947.     NULL,            /* 0,17 transparent to NeXT */
  5948.     NULL,            /* 0,18 transparent to CP437 */
  5949.     NULL,            /* 0,19 transparent to CP850 */
  5950.     NULL,            /* 0,20 transparent to CP852 */
  5951.     NULL,            /* 0,21 transparent to Macintosh Latin */
  5952.     NULL,            /* 0,22 transparent to DGI */
  5953.     NULL,            /* 0,23 transparent to HP */
  5954.     NULL,            /* 0,24 transparent to Latin/Cyrillic */
  5955.     NULL,                       /* 0,25 transparent to CP866 */
  5956.     NULL,            /* 0,26 transparent to Short KOI-7 */
  5957.     NULL,                       /* 0,27 transparent to Old KOI-8 Cyrillic */
  5958.     NULL,            /* 0,28 transparent to JIS-7 */
  5959.     NULL,            /* 0,29 transparent to Shift-JIS */
  5960.     NULL,            /* 0,30 transparent to J-EUC */
  5961.     NULL,            /* 0,31 transparent to DEC Kanji */
  5962.     NULL,            /* 0,32 transparent to Hebrew-7 */
  5963.     NULL,            /* 0,33 transparent to Latin/Hebrew */
  5964.     NULL,            /* 0,34 transparent to CP862 Hebrew */
  5965.     NULL,            /* 0,35 transparent to ELOT 927 Greek */
  5966.     NULL,            /* 0,36 transparent to Latin/Greek */
  5967.     NULL,            /* 0,37 transparent to CP869 */
  5968.     NULL,            /* 0,38 transparent to Latin-9 */
  5969.     NULL,            /* 0,39 transparent to CP858 */
  5970.     NULL,            /* 0,40 transparent to CP855 */
  5971.     NULL,            /* 0,41 transparent to CP1251 */
  5972.     NULL,            /* 0,42 transparent to Bulgarian */
  5973.     NULL,            /* 0,43 transparent to CP1250 */
  5974.     NULL,            /* 0,44 transparent to Mazovia */
  5975.     NULL,            /* 0,45 transparent to UCS-2 */
  5976.     NULL,            /* 0,46 transparent to UTF-8 */
  5977.     NULL,            /* 0,47 transparent to KOI8R */
  5978.     NULL,            /* 0,48 transparent to KOI8U */
  5979.     NULL,            /* 0,49 transparent to CP1252 */
  5980.     NULL,            /* 1,0 ascii to us ascii */
  5981.     NULL,            /* 1,1 ascii to uk ascii */
  5982.     NULL,            /* 1,2 ascii to dutch nrc */
  5983.     NULL,            /* 1,3 ascii to finnish nrc */
  5984.     NULL,            /* 1,4 ascii to french nrc */
  5985.     NULL,            /* 1,5 ascii to fr-canadian nrc */
  5986.     NULL,            /* 1,6 ascii to german nrc */
  5987.     NULL,            /* 1,7 ascii to hungarian nrc */
  5988.     NULL,            /* 1,8 ascii to italian nrc */
  5989.     NULL,            /* 1,9 ascii to norge/danish nrc */
  5990.     NULL,            /* 1,10 ascii to portuguese nrc */
  5991.     NULL,            /* 1,11 ascii to spanish nrc */
  5992.     NULL,            /* 1,12 ascii to swedish nrc */
  5993.     NULL,            /* 1,13 ascii to swiss nrc */
  5994.     NULL,            /* 1,14 ascii to latin-1 */
  5995.     NULL,            /* 1,15 ascii to latin-2 */
  5996.     NULL,            /* 1,16 ascii to DEC MCS */
  5997.     NULL,            /* 1,17 ascii to NeXT */
  5998.     NULL,            /* 1,18 ascii to CP437 */
  5999.     NULL,            /* 1,19 ascii to CP850 */
  6000.     NULL,            /* 1,20 ascii to CP852 */
  6001.     NULL,            /* 1,21 ascii to Macintosh Latin */
  6002.     NULL,            /* 1,22 ascii to DGI */
  6003.     NULL,            /* 1,23 ascii to HP */
  6004.     xaslc,                      /* 1,24 ascii to Latin/Cyrillic */
  6005.     xasac,                      /* 1,25 ascii to CP866 */
  6006.     xassk,                      /* 1,26 ascii to Short KOI */
  6007.     xask8,                      /* 1,27 ascii to Old KOI-8 Cyrillic */
  6008.     NULL,            /* 1,28 ascii to JIS-7 */
  6009.     NULL,            /* 1,29 ascii to Shift-JIS */
  6010.     NULL,            /* 1,30 ascii to J-EUC */
  6011.     NULL,            /* 1,31 ascii to DEC Kanji */
  6012.     xash7,            /* 1,32 ascii to Hebrew-7 */
  6013.     NULL,            /* 1,33 ascii to Latin/Hebrew */
  6014.     NULL,            /* 1,34 ascii to CP862 Hebrew */
  6015.     xaseg,            /* 1,35 ascii to ELOT 927 Greek */
  6016.     NULL,            /* 1,36 ascii to Latin/Greek */
  6017.     NULL,            /* 1,37 ascii to CP869 */
  6018.     NULL,            /* 1,38 ascii to Latin-9 */
  6019.     NULL,            /* 1,39 ascii to CP858 */
  6020.     xas55,            /* 1,40 ascii to CP855 */
  6021.     xas1251,            /* 1,41 ascii to CP1251 */
  6022.     xleft128,            /* 1,42 ascii to bulgarian */
  6023.     xleft128,            /* 1,43 ascii to CP1250 */
  6024.     xleft128,            /* 1,44 ascii to Mazovia */
  6025.     NULL,            /* 1,45 ascii to UCS-2 */
  6026.     NULL,            /* 1,46 ascii to UTF-8 */
  6027.     NULL,            /* 1,47 ascii to KOI8-R */
  6028.     NULL,            /* 1,48 ascii to KOI8-U */
  6029.     NULL,            /* 1,49 ascii to CP1252 */
  6030.     zl1as,            /* 2,0 latin-1 to us ascii */
  6031.     xl1uk,            /* 2,1 latin-1 to uk ascii */
  6032.     xl1du,            /* 2,2 latin-1 to dutch nrc */
  6033.     xl1fi,            /* 2,3 latin-1 to finnish nrc */
  6034.     xl1fr,            /* 2,4 latin-1 to french nrc */
  6035.     xl1fc,            /* 2,5 latin-1 to fr-canadian nrc */
  6036.     xl1ge,            /* 2,6 latin-1 to german nrc */
  6037.     xl1it,            /* 2,7 latin-1 to italian nrc */
  6038.     xl1hu,            /* 2,8 latin-1 to hungarian nrc */
  6039.     xl1no,            /* 2,9 latin-1 to norge/danish nrc */
  6040.     xl1po,            /* 2,10 latin-1 to portuguese nrc */
  6041.     xl1sp,            /* 2,11 latin-1 to spanish nrc */
  6042.     xl1sw,            /* 2,12 latin-1 to swedish nrc */
  6043.     xl1ch,            /* 2,13 latin-1 to swiss nrc */
  6044.     NULL,            /* 2,14 latin-1 to latin-1 */
  6045.     xl1l2,            /* 2,15 latin-1 to latin-2 */
  6046.     xl1dm,            /* 2,16 latin-1 to DEC MCS */
  6047.     xl1ne,            /* 2,17 latin-1 to NeXT */
  6048.     xl143,            /* 2,18 latin-1 to CP437 */
  6049.     xl185,            /* 2,19 latin-1 to CP850 */
  6050.     xl152,            /* 2,20 latin-1 to CP852 */
  6051.     xl1aq,            /* 2,21 latin-1 to Macintosh Latin */
  6052.     xl1dg,            /* 2,22 latin-1 to DGI */
  6053.     xl1r8,            /* 2,23 latin-1 to HP Roman8 */
  6054.     zl1as,            /* 2,24 latin-1 to Latin/Cyrillic */
  6055.     zl1as,                      /* 2,25 latin-1 to CP866 */
  6056.     xl1sk,                      /* 2,26 latin-1 to Short KOI */
  6057.     zl1as,                   /* 2,27 latin-1 to Old KOI-8 Cyrillic */
  6058.     NULL,            /* 2,28 latin-1 to JIS-7 */
  6059.     NULL,            /* 2,29 latin-1 to Shift-JIS */
  6060.     NULL,            /* 2,30 latin-1 to J-EUC */
  6061.     NULL,            /* 2,31 latin-1 to DEC Kanji */
  6062.     xl1h7,            /* 2,32 latin-1 to Hebrew-7 */
  6063.     xl1lh,            /* 2,33 latin-1 to Latin/Hebrew */
  6064.     xl162,            /* 2,34 latin-1 to CP862 Hebrew */
  6065.     xl1eg,            /* 2,35 latin-1 to ELOT 927 Greek */
  6066.     xl1lg,            /* 2,36 latin-1 to Latin/Greek */
  6067.     xl169,            /* 2,37 latin-1 to CP869 */
  6068.     NULL,            /* 2,38 latin-1 to Latin9 */
  6069.     xl185,            /* 2,39 latin-1 to CP858 */
  6070.     zl1as,            /* 2,40 latin-1 to CP855 */
  6071.     zl1as,            /* 2,41 latin-1 to CP1251 */
  6072.     zl1as,            /* 2,42 latin-1 to Bulgarian */
  6073.     xl11250,            /* 2,43 latin-1 to CP1250 */
  6074.     xl1mz,            /* 2,44 latin-1 to Mazovia */
  6075.     NULL,            /* 2,45 latin-1 to UCS-2 */
  6076.     NULL,            /* 2,46 latin-1 to UTF-8 */
  6077.     zl1as,            /* 2,47 latin-1 to KOI8R */
  6078.     zl1as,            /* 2,48 latin-1 to KOI8U */
  6079.     xl1w1,            /* 2,49 latin-1 to CP1252 */
  6080.     xl2as,            /* 3,0 latin-2 to us ascii */
  6081.     xl2as,            /* 3,1 latin-2 to uk ascii */
  6082.     xl2as,            /* 3,2 latin-2 to dutch nrc */
  6083.     xl2as,            /* 3,3 latin-2 to finnish nrc */
  6084.     xl2as,            /* 3,4 latin-2 to french nrc */
  6085.     xl2as,            /* 3,5 latin-2 to fr-canadian nrc */
  6086.     xl2as,            /* 3,6 latin-2 to german nrc */
  6087.     xl2as,            /* 3,7 latin-2 to italian nrc */
  6088.     xl2as,            /* 3,8 latin-2 to hungarian nrc */
  6089.     xl2as,            /* 3,9 latin-2 to norge/danish nrc */
  6090.     xl2as,            /* 3,10 latin-2 to portuguese nrc */
  6091.     xl2as,            /* 3,11 latin-2 to spanish nrc */
  6092.     xl2as,            /* 3,12 latin-2 to swedish nrc */
  6093.     xl2as,            /* 3,13 latin-2 to swiss nrc */
  6094.     xl2l1,            /* 3,14 latin-2 to latin-1 */
  6095.     NULL,            /* 3,15 latin-2 to latin-2 */
  6096.     xl2l1,            /* 3,16 latin-2 to DEC MCS */
  6097.     xl2ne,            /* 3,17 latin-2 to NeXT */
  6098.     xl243,            /* 3,18 latin-2 to CP437 */
  6099.     xl285,            /* 3,19 latin-2 to CP850 */
  6100.     xl252,            /* 3,20 latin-2 to CP852 */
  6101.     xl2aq,            /* 3,21 latin-2 to Macintosh Latin */
  6102.     xl2dg,            /* 3,22 latin-2 to DGI */
  6103.     xl2r8,            /* 3,23 latin-2 to HP */
  6104.     xl2as,            /* 3,24 latin-2 to Latin/Cyrillic */
  6105.     xl2as,                      /* 3,25 latin-2 to CP866 */
  6106.     xl2sk,                      /* 3,26 latin-2 to Short KOI */
  6107.     xl2as,                   /* 3,27 latin-2 to Old KOI-8 Cyrillic */
  6108.     NULL,            /* 3,28 latin-2 to JIS-7 */
  6109.     NULL,            /* 3,29 latin-2 to Shift-JIS */
  6110.     NULL,            /* 3,30 latin-2 to J-EUC */
  6111.     NULL,            /* 3,31 latin-2 to DEC Kanji */
  6112.     xl2h7,            /* 3,32 latin-2 to Hebrew-7 */
  6113.     xl2as,            /* 3,33 latin-2 to Latin/Hebrew */
  6114.     xl2as,            /* 3,34 latin-2 to CP862 Hebrew */
  6115.     xassk,            /* 3,35 latin-2 to ELOT 927 Greek */
  6116.     xl2as,            /* 3,36 latin-2 to Latin/Greek */
  6117.     xl2as,            /* 3,37 latin-2 to CP869 */
  6118.     xl2l9,            /* 3,38 latin-2 to Latin-9 */
  6119.     xl258,            /* 3,39 latin-2 to CP858 */
  6120.     xl2as,            /* 3,40 latin-2 to CP855 */
  6121.     xl2as,            /* 3,41 latin-2 to CP1251 */
  6122.     xl2as,            /* 3,42 latin-2 to Bulgarian */
  6123.     xl21250,            /* 3,43 latin-2 to CP1250 */
  6124.     xl2mz,            /* 3,44 latin-2 to Mazovia */
  6125.     NULL,            /* 3,45 latin-2 to UCS-2 */
  6126.     NULL,            /* 3,46 latin-2 to UTF-8 */
  6127.     xl2as,            /* 3,47 latin-2 to KOI8R */
  6128.     xl2as,            /* 3,48 latin-2 to KOI8U */
  6129.     xl2w1,            /* 3,49 latin-2 to CP1252 */
  6130.     xlcas,            /* 4,0 latin/cyrillic to us ascii */
  6131.     xlcas,            /* 4,1 latin/cyrillic to uk ascii */
  6132.     xlcas,                 /* 4,2 latin/cyrillic to dutch nrc */
  6133.     xlcas,            /* 4,3 latin/cyrillic to finnish ascii */
  6134.     xlcas,            /* 4,4 latin/cyrillic to french nrc */
  6135.     xlcas,            /* 4,5 latin/cyrillic to fr-canadian nrc */
  6136.     xlcas,            /* 4,6 latin/cyrillic to german nrc */
  6137.     xlcas,            /* 4,7 latin/cyrillic to italian nrc */
  6138.     xlcas,            /* 4,8 latin/cyrillic to hungarian nrc */
  6139.     xlcas,            /* 4,9 latin/cyrillic to norge/danish nrc */
  6140.     xlcas,            /* 4,10 latin/cyrillic to portuguese nrc */
  6141.     xlcas,            /* 4,11 latin/cyrillic to spanish nrc */
  6142.     xlcas,            /* 4,12 latin/cyrillic to swedish nrc */
  6143.     xlcas,            /* 4,13 latin/cyrillic to swiss nrc */
  6144.     xlcas,            /* 4,14 latin/cyrillic to latin-1 */
  6145.     xlcas,            /* 4,15 latin/cyrillic to latin-2 */
  6146.     xlcas,            /* 4,16 latin/cyrillic to DEC MCS */
  6147.     xlcas,            /* 4,17 latin/cyrillic to NeXT */
  6148.     xlcas,            /* 4,18 latin/cyrillic to CP437 */
  6149.     xlcas,            /* 4,19 latin/cyrillic to CP850 */
  6150.     xlcas,            /* 4,20 latin/cyrillic to CP852 */
  6151.     xlcas,            /* 4,21 latin/cyrillic to Macintosh Latin */
  6152.     xlcas,            /* 4,22 latin/cyrillic to DGI */
  6153.     xlcas,            /* 4,23 latin/cyrillic to HP */
  6154.     NULL,                       /* 4,24 latin/cyrillic to Latin/Cyrillic */
  6155.     xlcac,                      /* 4,25 latin/cyrillic to CP866 */
  6156.     xlcsk,                      /* 4,26 latin/cyrillic to Short KOI */
  6157.     xlck8,                   /* 4,27 latin/cyrillic to Old KOI-8 Cyrillic */
  6158.     NULL,            /* 4,28 latin/cyril to JIS-7 */
  6159.     NULL,            /* 4,29 latin/cyril to Shift-JIS */
  6160.     NULL,            /* 4,30 latin/cyril to J-EUC */
  6161.     NULL,            /* 4,31 latin/cyril to DEC Kanji */
  6162.     xlch7,            /* 4,32 latin/cyril to Hebrew-7 */
  6163.     xlcas,            /* 4,33 latin/cyril to Latin/Hebrew */
  6164.     xlcas,            /* 4,34 latin/cyril to CP862 Hebrew */
  6165.     xassk,            /* 4,35 latin/cyril to ELOT 927 Greek */
  6166.     xleft160,            /* 4,36 latin/cyril to Latin/Greek */
  6167.     xleft128,            /* 4,37 latin/cyril to CP869 */
  6168.     xlcas,            /* 4,38 latin/cyril to latin-9 */
  6169.     xlcas,            /* 4,39 latin/cyril to CP858 */
  6170.     xlc55,            /* 4,40 latin/cyril to CP855 */
  6171.     xlc1251,            /* 4,41 latin/cyril to CP1251 */
  6172.     xlcbu,            /* 4,42 latin/cyril to Bulgarian */
  6173.     xlcas,            /* 4,43 latin/cyril to CP1250 */
  6174.     xlcas,            /* 4,44 latin/cyril to Mazovia */
  6175.     NULL,            /* 4,45 latin/cyril to UCS-2 */
  6176.     NULL,            /* 4,46 latin/cyril to UTF-8 */
  6177.     xlckr,            /* 4,47 latin/cyril to KOI8R */
  6178.     xlcku,            /* 4,48 latin/cyril to KOI8U */
  6179.     xlcas,            /* 4,49 latin/cyril to CP1252 */
  6180.     NULL,            /* 5,00 */
  6181.     NULL,            /* 5,01 */
  6182.     NULL,            /* 5,02 */
  6183.     NULL,            /* 5,03 */
  6184.     NULL,            /* 5,04 */
  6185.     NULL,            /* 5,05 */
  6186.     NULL,            /* 5,06 */
  6187.     NULL,            /* 5,07 */
  6188.     NULL,            /* 5,08 */
  6189.     NULL,            /* 5,09 */
  6190.     NULL,            /* 5,10 */
  6191.     NULL,            /* 5,11 */
  6192.     NULL,            /* 5,12 */
  6193.     NULL,            /* 5,13 */
  6194.     NULL,            /* 5,14 */
  6195.     NULL,            /* 5,15 */
  6196.     NULL,            /* 5,16 */
  6197.     NULL,            /* 5,17 */
  6198.     NULL,            /* 5,18 */
  6199.     NULL,            /* 5,19 */
  6200.     NULL,            /* 5,20 */
  6201.     NULL,            /* 5,21 */
  6202.     NULL,            /* 5,22 */
  6203.     NULL,            /* 5,23 */
  6204.     NULL,            /* 5,24 */
  6205.     NULL,            /* 5,25 */
  6206.     NULL,            /* 5,26 */
  6207.     NULL,            /* 5,27 */
  6208.     NULL,            /* 5,28 */
  6209.     NULL,            /* 5,29 */
  6210.     NULL,            /* 5,30 */
  6211.     NULL,            /* 5,31 */
  6212.     NULL,            /* 5,32 */
  6213.     NULL,            /* 5,33 */
  6214.     NULL,            /* 5,34 */
  6215.     NULL,            /* 5,35 */
  6216.     NULL,            /* 5,36 */
  6217.     NULL,            /* 5,37 */
  6218.     NULL,            /* 5,38 */
  6219.     NULL,            /* 5,39 */
  6220.     NULL,            /* 5,40 */
  6221.     NULL,            /* 5,41 */
  6222.     NULL,            /* 5,42 */
  6223.     NULL,            /* 5,43 */
  6224.     NULL,            /* 5,44 */
  6225.     NULL,            /* 5,45 */
  6226.     NULL,            /* 5,46 */
  6227.     NULL,            /* 5,47 */
  6228.     NULL,            /* 5,48 */
  6229.     NULL,            /* 5,49 */
  6230.     xlhas,            /* 6,0 latin/hebrew to us ascii */
  6231.     xlhas,            /* 6,1 latin/hebrew to uk ascii */
  6232.     xlhas,                 /* 6,2 latin/hebrew to dutch nrc */
  6233.     xlhas,            /* 6,3 latin/hebrew to finnish ascii */
  6234.     xlhas,            /* 6,4 latin/hebrew to french nrc */
  6235.     xlhas,            /* 6,5 latin/hebrew to fr-canadian nrc */
  6236.     xlhas,            /* 6,6 latin/hebrew to german nrc */
  6237.     xlhas,            /* 6,7 latin/hebrew to italian nrc */
  6238.     xlhas,            /* 6,8 latin/hebrew to hungarian nrc */
  6239.     xlhas,            /* 6,9 latin/hebrew to norge/danish nrc */
  6240.     xlhas,            /* 6,10 latin/hebrew to portuguese nrc */
  6241.     xlhas,            /* 6,11 latin/hebrew to spanish nrc */
  6242.     xlhas,            /* 6,12 latin/hebrew to swedish nrc */
  6243.     xlhas,            /* 6,13 latin/hebrew to swiss nrc */
  6244.     xlhl1,            /* 6,14 latin/hebrew to latin-1 */
  6245.     xlhas,            /* 6,15 latin/hebrew to latin-2 */
  6246.     xlhl1,            /* 6,16 latin/hebrew to DEC MCS */
  6247.     xlhas,            /* 6,17 latin/hebrew to NeXT */
  6248.     xlhas,            /* 6,18 latin/hebrew to CP437 */
  6249.     xlhas,            /* 6,19 latin/hebrew to CP850 */
  6250.     xlhas,            /* 6,20 latin/hebrew to CP852 */
  6251.     xlhas,            /* 6,21 latin/hebrew to Macintosh Latin */
  6252.     xlhas,            /* 6,22 latin/hebrew to DGI */
  6253.     xlhas,                      /* 6,23 latin/hebrew to HP */
  6254.     xlhas,                      /* 6,24 latin/hebrew to Latin/Cyrillic */
  6255.     xlhas,                      /* 6,25 latin/hebrew to CP866 */
  6256.     NULL,                       /* 6,26 latin/hebrew to Short KOI */
  6257.     xlhas,                   /* 6,27 latin/hebrew to Old KOI-8 Cyrillic */
  6258.     NULL,            /* 6,28 latin/hebrew to JIS-7 */
  6259.     NULL,            /* 6,29 latin/hebrew to Shift-JIS */
  6260.     NULL,            /* 6,30 latin/hebrew to J-EUC */
  6261.     NULL,            /* 6,31 latin/hebrew to DEC Kanji */
  6262.     xlhh7,            /* 6,32 latin/hebrew to Hebrew-7 */
  6263.     NULL,            /* 6,33 latin/hebrew to Latin/Hebrew */
  6264.     xlh62,            /* 6,34 latin/hebrew to CP862 Hebrew */
  6265.     NULL,            /* 6,35 latin/hebrew to ELOT 927 Greek */
  6266.     xlhas,            /* 6,36 latin/hebrew to Latin/Greek */
  6267.     xlhas,            /* 6,37 latin/hebrew to CP869 */
  6268.     xlhas,            /* 6,38 latin/hebrew to Latin-9 */
  6269.     xlhas,            /* 6,39 latin/hebrew to CP858 */
  6270.     xlhas,            /* 6,40 latin/hebrew to CP855 */
  6271.     xlhas,            /* 6,41 latin/hebrew to CP1251 */
  6272.     xlhas,            /* 6,42 latin/hebrew to Bulgarian */
  6273.     xlhas,            /* 6,43 latin/hebrew to CP1250 */
  6274.     xlhas,            /* 6,44 latin/hebrew to Mazovia */
  6275.     NULL,            /* 6,45 latin/hebrew to UCS-2 */
  6276.     NULL,            /* 6,46 latin/hebrew to UTF-8 */
  6277.     NULL,            /* 6,47 latin/hebrew to KOI8R */
  6278.     NULL,            /* 6,48 latin/hebrew to KOI8U */
  6279.     xlhw1,            /* 6,49 latin/hebrew to CP1252 */
  6280.     xlgas,            /* 7,0 latin/greek to us ascii */
  6281.     xlgas,            /* 7,1 latin/greek to uk ascii */
  6282.     xlgas,                 /* 7,2 latin/greek to dutch nrc */
  6283.     xlgas,            /* 7,3 latin/greek to finnish ascii */
  6284.     xlgas,            /* 7,4 latin/greek to french nrc */
  6285.     xlgas,            /* 7,5 latin/greek to fr-canadian nrc */
  6286.     xlgas,            /* 7,6 latin/greek to german nrc */
  6287.     xlgas,            /* 7,7 latin/greek to italian nrc */
  6288.     xlgas,            /* 7,8 latin/greek to hungarian nrc */
  6289.     xlgas,            /* 7,9 latin/greek to norge/danish nrc */
  6290.     xlgas,            /* 7,10 latin/greek to portuguese nrc */
  6291.     xlgas,            /* 7,11 latin/greek to spanish nrc */
  6292.     xlgas,            /* 7,12 latin/greek to swedish nrc */
  6293.     xlgas,            /* 7,13 latin/greek to swiss nrc */
  6294.     xlgas,            /* 7,14 latin/greek to latin-1 */
  6295.     xlgas,            /* 7,15 latin/greek to latin-2 */
  6296.     xlgas,            /* 7,16 latin/greek to DEC MCS */
  6297.     xlgas,            /* 7,17 latin/greek to NeXT */
  6298.     xlgas,            /* 7,18 latin/greek to CP437 */
  6299.     xlgas,            /* 7,19 latin/greek to CP850 */
  6300.     xlgas,            /* 7,20 latin/greek to CP852 */
  6301.     xlgas,            /* 7,21 latin/greek to Macintosh Latin */
  6302.     xlgas,            /* 7,22 latin/greek to DGI */
  6303.     xlgas,            /* 7,23 latin/greek to HP */
  6304.     xleft160,                   /* 7,24 latin/greek to Latin/Cyrillic */
  6305.     xleft128,                   /* 7,25 latin/greek to CP866 */
  6306.     xassk,                      /* 7,26 latin/greek to Short KOI */
  6307.     xleft160,                   /* 7,27 latin/greek to Old KOI-8 Greek */
  6308.     NULL,            /* 7,28 latin/greek to JIS-7 */
  6309.     NULL,            /* 7,29 latin/greek to Shift-JIS */
  6310.     NULL,            /* 7,30 latin/greek to J-EUC */
  6311.     NULL,            /* 7,31 latin/greek to DEC Kanji */
  6312.     NULL,            /* 7,32 latin/greek to Hebrew-7 */
  6313.     xlgas,            /* 7,33 latin/greek to Latin/Hebrew */
  6314.     xlgas,            /* 7,34 latin/greek to CP862 Hebrew */
  6315.     xlgeg,            /* 7,35 latin/greek to ELOT 927 Greek */
  6316.     NULL,            /* 7,36 latin/greek to Latin/Greek */
  6317.     xlg69,            /* 7,37 latin/greek to CP869 */
  6318.     xlgas,            /* 7,38 latin/greek to Latin-9 */
  6319.     xlgas,            /* 7,39 latin/greek to CP858 */
  6320.     xleft128,            /* 7,40 latin/greek to CP855 */
  6321.     xleft128,            /* 7,41 latin/greek to CP1251 */
  6322.     xleft128,            /* 7,42 latin/greek to Bulgarian */
  6323.     xleft128,            /* 7,43 latin/greek to CP1250 */
  6324.     xleft128,            /* 7,44 latin/greek to Mazovia */
  6325.     NULL,            /* 7,45 latin/greek to UCS-2 */
  6326.     NULL,            /* 7,46 latin/greek to UTF-8 */
  6327.     NULL,            /* 7,47 latin/greek to KOI8R */
  6328.     NULL,            /* 7,48 latin/greek to KOI8U */
  6329.     xlgw1,            /* 7,49 latin/greek to CP1252 */
  6330.     zl9as,            /* 8,0 latin-9 to us ascii */
  6331.     xl1uk,            /* 8,1 latin-9 to uk ascii */
  6332.     xl1du,            /* 8,2 latin-9 to dutch nrc */
  6333.     xl1fi,            /* 8,3 latin-9 to finnish nrc */
  6334.     xl1fr,            /* 8,4 latin-9 to french nrc */
  6335.     xl1fc,            /* 8,5 latin-9 to fr-canadian nrc */
  6336.     xl1ge,            /* 8,6 latin-9 to german nrc */
  6337.     xl1it,            /* 8,7 latin-9 to italian nrc */
  6338.     xl1hu,            /* 8,8 latin-9 to hungarian nrc */
  6339.     xl1no,            /* 8,9 latin-9 to norge/danish nrc */
  6340.     xl1po,            /* 8,10 latin-9 to portuguese nrc */
  6341.     xl1sp,            /* 8,11 latin-9 to spanish nrc */
  6342.     xl1sw,            /* 8,12 latin-9 to swedish nrc */
  6343.     xl1ch,            /* 8,13 latin-9 to swiss nrc */
  6344.     NULL,            /* 8,14 latin-9 to latin-1 */
  6345.     xl1l2,            /* 8,15 latin-9 to latin-2 */
  6346.     xl9dm,            /* 8,16 latin-9 to DEC MCS */
  6347.     xl9ne,            /* 8,17 latin-9 to NeXT */
  6348.     xl143,            /* 8,18 latin-9 to CP437 */
  6349.     xl185,            /* 8,19 latin-9 to CP850 */
  6350.     xl152,            /* 8,20 latin-9 to CP852 */
  6351.     xl1aq,            /* 8,21 latin-9 to Macintosh Latin */
  6352.     xl1dg,            /* 8,22 latin-9 to DGI */
  6353.     xl1r8,            /* 8,23 latin-9 to HP Roman8 */
  6354.     zl1as,            /* 8,24 latin-9 to Latin/Cyrillic */
  6355.     zl1as,                      /* 8,25 latin-9 to CP866 */
  6356.     xl1sk,                      /* 8,26 latin-9 to Short KOI */
  6357.     zl1as,                   /* 8,27 latin-9 to Old KOI-8 Cyrillic */
  6358.     NULL,            /* 8,28 latin-9 to JIS-7 */
  6359.     NULL,            /* 8,29 latin-9 to Shift-JIS */
  6360.     NULL,            /* 8,30 latin-9 to J-EUC */
  6361.     NULL,            /* 8,31 latin-9 to DEC Kanji */
  6362.     xl1h7,            /* 8,32 latin-9 to Hebrew-7 */
  6363.     xl1lh,            /* 8,33 latin-9 to Latin/Hebrew */
  6364.     xl162,            /* 8,34 latin-9 to CP862 Hebrew */
  6365.     xl1eg,            /* 8,35 latin-9 to ELOT 927 Greek */
  6366.     xl1lg,            /* 8,36 latin-9 to Latin/Greek */
  6367.     xl169,            /* 8,37 latin-9 to CP869 */
  6368.     NULL,            /* 8,38 latin-9 to Latin9 */
  6369.     xl958,            /* 8,39 latin-9 to CP858 */
  6370.     zl1as,            /* 8,40 latin-9 to CP855 */
  6371.     zl1as,            /* 8,41 latin-9 to CP1251 */
  6372.     xl1as,            /* 8,42 latin-9 to Bulgarian */
  6373.     xl91250,            /* 8,43 latin-9 to CP1250 */
  6374.     xl9mz,            /* 8,44 latin-9 to Mazovia */
  6375.     NULL,            /* 8,45 latin-9 to UCS-2 */
  6376.     NULL,            /* 8,46 latin-9 to UTF-8 */
  6377.     zl1as,            /* 8,47 latin-9 to KOI8-R */
  6378.     zl1as,            /* 8,48 latin-9 to KOI8-U */
  6379.     xl9w1,            /* 8,49 latin-9 to CP1252 */
  6380.     NULL,            /* 9,00 Unicode... */
  6381.     NULL,            /* 9,01 */
  6382.     NULL,            /* 9,02 */
  6383.     NULL,            /* 9,03 */
  6384.     NULL,            /* 9,04 */
  6385.     NULL,            /* 9,05 */
  6386.     NULL,            /* 9,06 */
  6387.     NULL,            /* 9,07 */
  6388.     NULL,            /* 9,08 */
  6389.     NULL,            /* 9,09 */
  6390.     NULL,            /* 9,10 */
  6391.     NULL,            /* 9,11 */
  6392.     NULL,            /* 9,12 */
  6393.     NULL,            /* 9,13 */
  6394.     NULL,            /* 9,14 */
  6395.     NULL,            /* 9,15 */
  6396.     NULL,            /* 9,16 */
  6397.     NULL,            /* 9,17 */
  6398.     NULL,            /* 9,18 */
  6399.     NULL,            /* 9,19 */
  6400.     NULL,            /* 9,20 */
  6401.     NULL,            /* 9,21 */
  6402.     NULL,            /* 9,22 */
  6403.     NULL,            /* 9,23 */
  6404.     NULL,            /* 9,24 */
  6405.     NULL,            /* 9,25 */
  6406.     NULL,            /* 9,26 */
  6407.     NULL,            /* 9,27 */
  6408.     NULL,            /* 9,28 */
  6409.     NULL,            /* 9,29 */
  6410.     NULL,            /* 9,30 */
  6411.     NULL,            /* 9,31 */
  6412.     NULL,            /* 9,32 */
  6413.     NULL,            /* 9,33 */
  6414.     NULL,            /* 9,34 */
  6415.     NULL,            /* 9,35 */
  6416.     NULL,            /* 9,36 */
  6417.     NULL,            /* 9,37 */
  6418.     NULL,            /* 9,38 */
  6419.     NULL,            /* 9,39 */
  6420.     NULL,            /* 9,40 */
  6421.     NULL,            /* 9,41 */
  6422.     NULL,            /* 9,42 */
  6423.     NULL,            /* 9,43 */
  6424.     NULL,            /* 9,44 */
  6425.     NULL,            /* 9,45 */
  6426.     NULL,            /* 9,46 */
  6427.     NULL,            /* 9,47 */
  6428.     NULL,            /* 9,48 */
  6429.     NULL,            /* 9,49 */
  6430.     NULL,            /* 10,00 */
  6431.     NULL,            /* 10,01 */
  6432.     NULL,            /* 10,02 */
  6433.     NULL,            /* 10,03 */
  6434.     NULL,            /* 10,04 */
  6435.     NULL,            /* 10,05 */
  6436.     NULL,            /* 10,06 */
  6437.     NULL,            /* 10,07 */
  6438.     NULL,            /* 10,08 */
  6439.     NULL,            /* 10,09 */
  6440.     NULL,            /* 10,10 */
  6441.     NULL,            /* 10,11 */
  6442.     NULL,            /* 10,12 */
  6443.     NULL,            /* 10,13 */
  6444.     NULL,            /* 10,14 */
  6445.     NULL,            /* 10,15 */
  6446.     NULL,            /* 10,16 */
  6447.     NULL,            /* 10,17 */
  6448.     NULL,            /* 10,18 */
  6449.     NULL,            /* 10,19 */
  6450.     NULL,            /* 10,20 */
  6451.     NULL,            /* 10,21 */
  6452.     NULL,            /* 10,22 */
  6453.     NULL,            /* 10,23 */
  6454.     NULL,            /* 10,24 */
  6455.     NULL,            /* 10,25 */
  6456.     NULL,            /* 10,26 */
  6457.     NULL,            /* 10,27 */
  6458.     NULL,            /* 10,28 */
  6459.     NULL,            /* 10,29 */
  6460.     NULL,            /* 10,30 */
  6461.     NULL,            /* 10,31 */
  6462.     NULL,            /* 10,32 */
  6463.     NULL,            /* 10,33 */
  6464.     NULL,            /* 10,34 */
  6465.     NULL,            /* 10,35 */
  6466.     NULL,            /* 10,36 */
  6467.     NULL,            /* 10,37 */
  6468.     NULL,            /* 10,38 */
  6469.     NULL,            /* 10,39 */
  6470.     NULL,            /* 10,40 */
  6471.     NULL,            /* 10,41 */
  6472.     NULL,            /* 10,42 */
  6473.     NULL,            /* 10,43 */
  6474.     NULL,            /* 10,44 */
  6475.     NULL,            /* 10,45 */
  6476.     NULL,            /* 10,46 */
  6477.     NULL,            /* 10,47 */
  6478.     NULL,            /* 10,48 */
  6479.     NULL            /* 10,49 */
  6480. };
  6481. int nxlr = (sizeof(xlr) / sizeof(CHAR *));
  6482.  
  6483. /*
  6484.   Translation function table for sending files.
  6485.   Array of pointers to functions for translating from the local file
  6486.   character set to the transfer character set.  Indexed in the same
  6487.   way as the xlr array above, but with the indices reversed.
  6488. */
  6489. #ifdef CK_ANSIC
  6490. CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])(CHAR) =
  6491. #else
  6492. CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])() =
  6493. #endif /* CK_ANSIC */
  6494. {
  6495.     NULL,            /* 0,0 us ascii to transparent */
  6496.     NULL,            /* 0,1 uk ascii to transparent */
  6497.     NULL,            /* 0,2 dutch nrc to transparent */
  6498.     NULL,            /* 0,3 finnish nrc to transparent */
  6499.     NULL,            /* 0,4 french nrc to transparent */
  6500.     NULL,            /* 0,5 fr-canadian nrc to transparent */
  6501.     NULL,            /* 0,6 german nrc to transparent */
  6502.     NULL,            /* 0,7 hungarian nrc to transparent */
  6503.     NULL,            /* 0,8 italian nrc to transparent */
  6504.     NULL,            /* 0,9 norge/danish nrc to transparent */
  6505.     NULL,            /* 0,10 portuguese nrc to transparent */
  6506.     NULL,            /* 0,11 spanish nrc to transparent */
  6507.     NULL,            /* 0,12 swedish nrc to transparent */
  6508.     NULL,            /* 0,13 swiss nrc to transparent */
  6509.     NULL,            /* 0,14 latin-1 to transparent */
  6510.     NULL,            /* 0,15 latin-2 to transparent */
  6511.     NULL,            /* 0,16 DEC MCS to transparent */
  6512.     NULL,            /* 0,17 NeXT to transparent */
  6513.     NULL,            /* 0,18 CP437 to transparent */
  6514.     NULL,            /* 0,19 CP850 to transparent */
  6515.     NULL,            /* 0,20 CP852 to transparent */
  6516.     NULL,            /* 0,21 Macintosh Latin to transparent */
  6517.     NULL,            /* 0,22 DGI to transparent */
  6518.     NULL,            /* 0,23 HP to transparent */
  6519.     NULL,            /* 0,24 Latin/Cyrillic to transparent */
  6520.     NULL,                       /* 0,25 CP866 to transparent */
  6521.     NULL,                       /* 0,26 Short KOI to transparent */
  6522.     NULL,                       /* 0,27 Old KOI-8 to transparent */
  6523.     NULL,            /* 0,28 JIS-7 to transparent */
  6524.     NULL,            /* 0,29 Shift JIS to transparent */
  6525.     NULL,            /* 0,30 Japanese EUC to transparent */
  6526.     NULL,            /* 0,31 DEC Kanji to transparent */
  6527.     NULL,            /* 0,32 Hebrew-7 to transparent */
  6528.     NULL,            /* 0,33 Latin/Hebrew to transparent */
  6529.     NULL,            /* 0,34 CP862 Hebrew to transparent */
  6530.     NULL,            /* 0,35 ELOT 927 Greek to transparent */
  6531.     NULL,            /* 0,36 Latin/Greek to transparent */
  6532.     NULL,            /* 0,37 CP869 to transparent */
  6533.     NULL,            /* 0,38 Latin-9 to transparent */
  6534.     NULL,            /* 0,39 CP858 to transparent */
  6535.     NULL,            /* 0,40 CP855 to transparent */
  6536.     NULL,            /* 0,41 CP1251 to transparent */
  6537.     NULL,            /* 0,42 Bulgarian to transparent */
  6538.     NULL,            /* 0,43 CP1250 to transparent */
  6539.     NULL,            /* 0,44 Mazovia to transparent */
  6540.     NULL,            /* 0,45 UCS-2 to transparent */
  6541.     NULL,            /* 0,46 UTF-8 to transparent */
  6542.     NULL,            /* 0,47 KOI8R to transparent */
  6543.     NULL,            /* 0,48 KOI8U to transparent */
  6544.     NULL,            /* 0,49 CP1252 to transparent */
  6545.     NULL,            /* 1,0 us ascii to ascii */
  6546.     NULL,            /* 1,1 uk ascii to ascii */
  6547.     xduas,            /* 1,2 dutch nrc to ascii */
  6548.     xfias,            /* 1,3 finnish nrc to ascii */
  6549.     xfras,            /* 1,4 french nrc to ascii */
  6550.     xfcas,            /* 1,5 french canadian nrc to ascii */
  6551.     xgeas,            /* 1,6 german nrc to ascii */
  6552.     xhuas,            /* 1,7 hungarian nrc to ascii */
  6553.     xitas,            /* 1,8 italian nrc to ascii */
  6554.     xnoas,            /* 1,9 norwegian/danish nrc to ascii */
  6555.     xpoas,            /* 1,10 portuguese nrc to ascii */
  6556.     xspas,            /* 1,11 spanish nrc to ascii */
  6557.     xswas,            /* 1,12 swedish nrc to ascii */
  6558.     xchas,            /* 1,13 swiss nrc to ascii */
  6559.     xl1as,            /* 1,14 latin-1 to ascii */
  6560.     xl2as,            /* 1,15 latin-2 to ascii */
  6561.     xdmas,            /* 1,16 dec mcs to ascii */
  6562.     xneas,            /* 1,17 NeXT to ascii */
  6563.     x43as,            /* 1,18 CP437 to ascii */
  6564.     x85as,            /* 1,19 CP850 to ascii */
  6565.     x52as,            /* 1,20 CP850 to ascii */
  6566.     xaqas,            /* 1,21 Macintosh Latin to ascii */
  6567.     xdgas,            /* 1,22 DGI to ascii */
  6568.     xr8as,            /* 1,23 HP to ASCII */
  6569.     xlcas,            /* 1,24 Latin/Cyrillic to ASCII */
  6570.     xacas,                      /* 1,25 CP866 to ASCII */
  6571.     xskas,            /* 1,26 Short KOI to ASCII */
  6572.     xk8as,                      /* 1,27 Old KOI-8 Cyrillic to ASCII */
  6573.     NULL,            /* 1,28 */
  6574.     NULL,            /* 1,29 */
  6575.     NULL,            /* 1,30 */
  6576.     NULL,            /* 1,31 */
  6577.     xh7as,            /* 1,32 Hebrew-7 to ASCII */
  6578.     xlhas,            /* 1,33 Latin/Hebrew to ASCII */
  6579.     x62as,            /* 1,34 CP862 Hebrew to ASCII */
  6580.     xegas,            /* 1,35 ELOT 927 Greek to ASCII */
  6581.     xlgas,            /* 1,36 Latin/Greek to ASCII */
  6582.     x69as,            /* 1,37 CP869 to ASCII */
  6583.     xl9as,            /* 1,38 Latin-9 to ASCII */
  6584.     x58as,            /* 1,39 CP858 to ASCII */
  6585.     x55as,            /* 1,40 CP855 to ASCII */
  6586.     x1251as,            /* 1,41 CP1251 to ASCII */
  6587.     xleft128,            /* 1,42 Bulgarian to ASCII */
  6588.     x1250as,            /* 1,43 CP1250 to ASCII */
  6589.     xmzas,            /* 1,44 Mazovia to ASCII */
  6590.     NULL,            /* 1,45 UCS-2 to ASCII */
  6591.     NULL,            /* 1,46 UTF-8 to ASCII */
  6592.     xk8as,            /* 1,47 KOI8R to ASCII */
  6593.     xk8as,            /* 1,48 KOI8U to ASCII */
  6594.     xw1as,            /* 1,49 CP1252 to ASCII */
  6595.     NULL,            /* 2,0 us ascii to latin-1 */
  6596.     xukl1,            /* 2,1 uk ascii to latin-1 */
  6597.     xdul1,            /* 2,2 dutch nrc to latin-1 */
  6598.     xfil1,            /* 2,3 finnish nrc to latin-1 */
  6599.     xfrl1,            /* 2,4 french nrc to latin-1 */
  6600.     xfcl1,            /* 2,5 french canadian nrc to latin-1 */
  6601.     xgel1,            /* 2,6 german nrc to latin-1 */
  6602.     xhul1,            /* 2,7 hungarian nrc to latin-1 */
  6603.     xitl1,            /* 2,8 italian nrc to latin-1 */
  6604.     xnol1,            /* 2,9 norwegian/danish nrc to latin-1 */
  6605.     xpol1,            /* 2,10 portuguese nrc to latin-1 */
  6606.     xspl1,            /* 2,11 spanish nrc to latin-1 */
  6607.     xswl1,            /* 2,12 swedish nrc to latin-1 */
  6608.     xchl1,            /* 2,13 swiss nrc to latin-1 */
  6609.     NULL,            /* 2,14 latin-1 to latin-1 */
  6610.     xl2l1,            /* 2,15 latin-2 to latin-1 */
  6611.     xdml1,            /* 2,16 dec mcs to latin-1 */
  6612.     xnel1,                      /* 2,17 NeXT to Latin-1 */
  6613.     x43l1,                      /* 2,18 CP437 to Latin-1 */
  6614.     x85l1,                      /* 2,19 CP850 to Latin-1 */
  6615.     x52l1,                      /* 2,20 CP852 to Latin-1 */
  6616.     xaql1,                      /* 2,21 Macintosh Latin to Latin-1 */
  6617.     xdgl1,                      /* 2,22 DGI to Latin-1 */
  6618.     xr8l1,                      /* 2,23 HP to Latin-1 */
  6619.     xlcas,                      /* 2,24 Latin/Cyrillic to Latin-1 */
  6620.     xacas,                      /* 2,25 CP866 to Latin-1 */
  6621.     xskas,                      /* 2,26 Short KOI to Latin-1 */
  6622.     xk8as,                      /* 2,27 Old KOI-8 Cyrillic to Latin-1 */
  6623.     NULL,            /* 2,28 Kanji ... */
  6624.     NULL,            /* 2,29 */
  6625.     NULL,            /* 2,30 */
  6626.     NULL,            /* 2,31 */
  6627.     xh7as,            /* 2,32 Hebrew-7 to Latin-1 */
  6628.     xlhl1,            /* 2,33 Latin/Hebrew to Latin-1 */
  6629.     x62l1,            /* 2,34 CP862 Hebrew to Latin-1 */
  6630.     xegas,            /* 2,35 ELOT 927 Greek to Latin-1 */
  6631.     xlgl1,            /* 2,36 Latin/Greek to Latin-1 */
  6632.     NULL,            /* 2,37 CP869 to Latin-1 */
  6633.     NULL,            /* 2,38 Latin-9 to Latin-1 */
  6634.     x58l1,            /* 2,39 CP858 to Latin-1 */
  6635.     x55as,            /* 2,40 CP855 to Latin-1 */
  6636.     x1251as,            /* 2,41 CP1251 to Latin-1 */
  6637.     xleft128,            /* 2,42 Bulgarian to Latin-1 */
  6638.     x1250l1,            /* 2,43 CP1250 to Latin-1 */
  6639.     xmzl1,            /* 2,44 Mazovia to Latin-1 */
  6640.     NULL,            /* 2,45 UCS-2 to Latin-1 */
  6641.     NULL,            /* 2,46 UTF-8 to Latin-1 */
  6642.     xk8as,            /* 2,47 KOI8R to Latin-1 */
  6643.     xk8as,            /* 2,48 KOI8U to Latin-1 */
  6644.     xw1l1,            /* 2,49 CP1252 to Latin-1 */
  6645.     NULL,            /* 3,0 us ascii to latin-2 */
  6646.     NULL,            /* 3,1 uk ascii to latin-2 */
  6647.     xduas,            /* 3,2 dutch nrc to latin-2 */
  6648.     xfias,            /* 3,3 finnish nrc to latin-2 */
  6649.     xfras,            /* 3,4 french nrc to latin-2 */
  6650.     xfcas,            /* 3,5 french canadian nrc to latin-2 */
  6651.     xgel2,            /* 3,6 german nrc to latin-2 */
  6652.     xhul2,            /* 3,7 hungarian nrc to latin-2 */
  6653.     xitas,            /* 3,8 italian nrc to latin-2 */
  6654.     xnoas,            /* 3,9 norwegian/danish nrc to latin-2 */
  6655.     xpoas,            /* 3,10 portuguese nrc to latin-2 */
  6656.     xspas,            /* 3,11 spanish nrc to latin-2 */
  6657.     xswas,            /* 3,12 swedish nrc to latin-2 */
  6658.     xchas,            /* 3,13 swiss nrc to latin-2 */
  6659.     xl1l2,            /* 3,14 latin-1 to latin-2 */
  6660.     NULL,            /* 3,15 latin-2 to latin-2 */
  6661.     xl1l2,            /* 3,16 dec mcs to latin-2 */
  6662.     xnel2,                      /* 3,17 NeXT to Latin-2 */
  6663.     x43l2,                      /* 3,18 CP437 to Latin-2 */
  6664.     x85l2,                      /* 3,19 CP850 to Latin-2 */
  6665.     x52l2,                      /* 3,20 CP852 to Latin-2 */
  6666.     xaql2,                      /* 3,21 Macintosh Latin to Latin-2 */
  6667.     xdgl2,                      /* 3,22 DGI to Latin-2 */
  6668.     xr8l2,                      /* 3,23 HP to Latin-2 */
  6669.     xlcas,                      /* 3,24 Latin/Cyrillic to Latin-2 */
  6670.     xacas,                      /* 3,25 CP866 to Latin-2 */
  6671.     xskas,                      /* 3,26 Short KOI to Latin-2 */
  6672.     xk8as,                      /* 3,27 Old KOI-8 Cyrillic to Latin-2 */
  6673.     NULL,            /* 3,28 Kanji ... */
  6674.     NULL,            /* 3,29 */
  6675.     NULL,            /* 3,30 */
  6676.     NULL,            /* 3,31 */
  6677.     xh7as,            /* 3,32 Hebrew-7 to Latin-2 */
  6678.     xlhas,            /* 3,33 Latin/Hebrew to Latin-2 */
  6679.     x62as,            /* 3,34 CP862 Hebrew to Latin-2 */
  6680.     xegas,            /* 3,35 ELOT 927 Greek to Latin-2 */
  6681.     xl2lg,            /* 3,36 Latin/Greek to Latin-2 */
  6682.     xleft128,            /* 3,37 CP869 to Latin-2 */
  6683.     xl9l2,            /* 3,38 Latin-9 to Latin-2 */
  6684.     x58l2,            /* 3,39 CP858 to Latin-2 */
  6685.     x55as,            /* 3,40 CP855 to Latin-2 */
  6686.     x1251as,            /* 3,41 CP1251 to Latin-2 */
  6687.     xleft128,            /* 3,42 Bulgarian to Latin-2 */
  6688.     x1250l2,            /* 3,43 CP1250 to Latin-2 */
  6689.     xmzl2,            /* 3,44 Mazovia to Latin-2 */
  6690.     NULL,            /* 3,45 UCS-2 to Latin-2 */
  6691.     NULL,            /* 3,46 UTF-8 to Latin-2 */
  6692.     xk8as,            /* 3,47 KOI8R to Latin-2 */
  6693.     xk8as,            /* 3,48 KOI8U to Latin-2 */
  6694.     xw1l2,            /* 3,49 CP1252 to latin-2 */
  6695.     xaslc,            /* 4,0 us ascii to latin/cyrillic */
  6696.     xaslc,            /* 4,1 uk ascii to latin/cyrillic */
  6697.     xduas,            /* 4,2 dutch nrc to latin/cyrillic */
  6698.     xfias,            /* 4,3 finnish nrc to latin/cyrillic */
  6699.     xfras,            /* 4,4 french nrc to latin/cyrillic */
  6700.     xfcas,            /* 4,5 french canadian nrc to latin/cyrillic */
  6701.     xgeas,            /* 4,6 german nrc to latin/cyrillic */
  6702.     xhuas,            /* 4,7 hungarian nrc to latin/cyrillic */
  6703.     xitas,            /* 4,8 italian nrc to latin/cyrillic */
  6704.     xnoas,            /* 4,9 norge/danish nrc to latin/cyrillic */
  6705.     xpoas,            /* 4,10 portuguese nrc to latin/cyrillic */
  6706.     xspas,            /* 4,11 spanish nrc to latin/cyrillic */
  6707.     xswas,            /* 4,12 swedish nrc to latin/cyrillic */
  6708.     xchas,            /* 4,13 swiss nrc to latin/cyrillic */
  6709.     xl1as,            /* 4,14 latin-1 to latin/cyrillic */
  6710.     xl2as,            /* 4,15 latin-2 to latin/cyrillic */
  6711.     xdmas,            /* 4,16 dec mcs to latin/cyrillic */
  6712.     xneas,            /* 4,17 NeXT to latin/cyrillic */
  6713.     x43as,            /* 4,18 CP437 to latin/cyrillic */
  6714.     x85as,            /* 4,19 CP850 to latin/cyrillic */
  6715.     x52as,            /* 4,20 CP852 to latin/cyrillic */
  6716.     xaqas,            /* 4,21 Macintosh Latin to latin/cyrillic */
  6717.     xdgas,            /* 4,22 DGI to Latin/Cyrillic */
  6718.     xr8as,            /* 4,23 HP to Latin/Cyrillic */
  6719.     NULL,                       /* 4,24 Latin/Cyrillic to Latin/Cyrillic */
  6720.     xaclc,                      /* 4,25 CP866 to Latin/Cyrillic */
  6721.     xskcy,                      /* 4,26 Short KOI to Latin/Cyrillic */
  6722.     xk8lc,                      /* 4,27 Old KOI-8 Cyrillic to Latin/Cyrillic */
  6723.     NULL,            /* 4,28 Kanji... */
  6724.     NULL,            /* 4,29 */
  6725.     NULL,            /* 4,30 */
  6726.     NULL,            /* 4,31 */
  6727.     xh7as,            /* 4,32 Hebrew-7 to Latin/Cyrillic */
  6728.     xlhas,            /* 4,33 Latin/Hebrew to Latin/Cyrillic */
  6729.     x62as,            /* 4,34 CP862 Hebrew to Latin/Cyrillic */
  6730.     xegas,            /* 4,35 ELOT 927 Greek to Latin/Cyrillic */
  6731.     xleft160,            /* 4,36 Latin/Greek to Latin/Cyrillic */
  6732.     xleft128,            /* 4,37 CP869 to Latin/Cyrillic */
  6733.     xl1as,            /* 4,38 latin-9 to latin/cyrillic */
  6734.     xleft128,            /* 4,39 CP858 to Latin/Cyrillic */
  6735.     x55lc,            /* 4,40 CP855 to Latin/Cyrillic */
  6736.     x1251lc,            /* 4,41 CP1251 to Latin/Cyrillic */
  6737.     xbulc,            /* 4,42 Bulgarian to Latin/Cyrillic */
  6738.     x1250as,            /* 4,43 CP1250 to Latin/Cyrillic */
  6739.     xmzas,            /* 4,44 Mazovia to Latin/Cyrillic */
  6740.     NULL,            /* 4,45 UCS-2 to Latin/Cyrillic */
  6741.     NULL,            /* 4,46 UTF-8 to Latin/Cyrillic */
  6742.     xkrlc,            /* 4,47 KOI8R to Latin/Cyrillic */
  6743.     xkulc,            /* 4,48 KOI8U to Latin/Cyrillic */
  6744.     xw1lc,            /* 4,49 CP1252 to Latin/Cyrillic */
  6745.     NULL,            /* 5,00 */
  6746.     NULL,            /* 5,01 */
  6747.     NULL,            /* 5,02 */
  6748.     NULL,            /* 5,03 */
  6749.     NULL,            /* 5,04 */
  6750.     NULL,            /* 5,05 */
  6751.     NULL,            /* 5,06 */
  6752.     NULL,            /* 4.07 */
  6753.     NULL,            /* 5,08 */
  6754.     NULL,            /* 5,09 */
  6755.     NULL,            /* 5,10 */
  6756.     NULL,            /* 5,11 */
  6757.     NULL,            /* 5,12 */
  6758.     NULL,            /* 5,13 */
  6759.     NULL,            /* 5,14 */
  6760.     NULL,            /* 5,15 */
  6761.     NULL,            /* 5,16 */
  6762.     NULL,            /* 5,17 */
  6763.     NULL,            /* 5,18 */
  6764.     NULL,            /* 5,19 */
  6765.     NULL,            /* 5,20 */
  6766.     NULL,            /* 5,21 */
  6767.     NULL,            /* 5,22 */
  6768.     NULL,            /* 5,23 */
  6769.     NULL,            /* 5,24 */
  6770.     NULL,            /* 5,25 */
  6771.     NULL,            /* 5,26 */
  6772.     NULL,            /* 5,27 */
  6773.     NULL,            /* 5,28 */
  6774.     NULL,            /* 5,29 */
  6775.     NULL,            /* 5,30 */
  6776.     NULL,            /* 5,31 */
  6777.     NULL,            /* 5,32 */
  6778.     NULL,            /* 5,33 */
  6779.     NULL,            /* 5,34 */
  6780.     NULL,            /* 5,35 */
  6781.     NULL,            /* 5,36 */
  6782.     NULL,            /* 5,37 */
  6783.     NULL,            /* 5,38 */
  6784.     NULL,            /* 5,39 */
  6785.     NULL,            /* 5,40 */
  6786.     NULL,            /* 5,41 */
  6787.     NULL,            /* 5,42 */
  6788.     NULL,            /* 5,43 */
  6789.     NULL,            /* 5,44 */
  6790.     NULL,            /* 5,45 */
  6791.     NULL,            /* 5,46 */
  6792.     NULL,            /* 5,47 */
  6793.     NULL,            /* 5,48 */
  6794.     NULL,            /* 5,49 */
  6795.     NULL,            /* 6,0 us ascii to Latin/Hebrew */
  6796.     NULL,            /* 6,1 uk ascii to Latin/Hebrew */
  6797.     xduas,            /* 6,2 dutch nrc to Latin/Hebrew */
  6798.     xfias,            /* 6,3 finnish nrc to Latin/Hebrew */
  6799.     xfras,            /* 6,4 french nrc to Latin/Hebrew */
  6800.     xfcas,            /* 6,5 french canadian nrc to Latin/Hebrew */
  6801.     xgeas,            /* 6,6 german nrc to Latin/Hebrew */
  6802.     xhuas,            /* 6,7 hungarian nrc to Latin/Hebrew */
  6803.     xitas,            /* 6,8 italian nrc to Latin/Hebrew */
  6804.     xnoas,            /* 6,9 norge/danish nrc to Latin/Hebrew */
  6805.     xpoas,            /* 6,10 portuguese nrc to Latin/Hebrew */
  6806.     xspas,            /* 6,11 spanish nrc to Latin/Hebrew */
  6807.     xswas,            /* 6,12 swedish nrc to Latin/Hebrew */
  6808.     xchas,            /* 6,13 swiss nrc to Latin/Hebrew */
  6809.     xl1lh,            /* 6,14 latin-1 to Latin/Hebrew */
  6810.     xl2as,            /* 6,15 latin-2 to Latin/Hebrew */
  6811.     xdmas,            /* 6,16 dec mcs to Latin/Hebrew */
  6812.     xneas,            /* 6,17 NeXT to Latin/Hebrew */
  6813.     x43as,            /* 6,18 CP437 to Latin/Hebrew */
  6814.     x85as,            /* 6,19 CP850 to Latin/Hebrew */
  6815.     x52as,            /* 6,20 CP852 to Latin/Hebrew */
  6816.     xaqas,            /* 6,21 Macintosh Latin to Latin/Hebrew */
  6817.     xdgas,            /* 6,22 DGI to Latin/Hebrew */
  6818.     xr8as,            /* 6,23 HP to Latin/Hebrew */
  6819.     xlcas,                      /* 6,24 Latin/Cyrillic to Latin/Hebrew */
  6820.     xacas,                      /* 6,25 CP866 to Latin/Hebrew */
  6821.     xskas,                      /* 6,26 Short KOI to Latin/Hebrew */
  6822.     xk8as,                      /* 6,27 Old KOI-8 Cyrillic to Latin/Hebrew */
  6823.     NULL,            /* 6,28 Kanji... */
  6824.     NULL,            /* 6,29 */
  6825.     NULL,            /* 6,30 */
  6826.     NULL,            /* 6,31 */
  6827.     xh7lh,            /* 6,32 Hebrew-7 to Latin/Hebrew */
  6828.     NULL,            /* 6,33 Latin/Hebrew to Latin/Hebrew */
  6829.     x62lh,            /* 6,34 CP862 Hebrew to Latin/Hebrew */
  6830.     xegas,            /* 6,35 ELOT 927 Greek to Latin/Hebrew */
  6831.     xlgas,            /* 6,36 Latin/Greek to Latin/Hebrew */
  6832.     x69as,            /* 6,37 CP869 to Latin/Hebrew */
  6833.     xl1as,            /* 6,38 latin-9 to Latin/Hebrew */
  6834.     x58as,            /* 6,39 CP858 to Latin/Hebrew */
  6835.     x55as,            /* 6,40 CP855 to Latin/Hebrew */
  6836.     x1251as,            /* 6,41 CP1251 to Latin/Hebrew */
  6837.     xleft128,            /* 6,42 Bulgarian to Latin/Hebrew */
  6838.     x1250as,            /* 6,43 CP1250 to Latin/Hebrew */
  6839.     xmzas,            /* 6,44 Mazovia to Latin/Hebrew */
  6840.     NULL,            /* 6,45 UCS-2 to Latin/Hebrew */
  6841.     NULL,            /* 6,46 UTF-8 to Latin/Hebrew */
  6842.     NULL,            /* 6,47 KOI8R to Latin/Hebrew */
  6843.     NULL,            /* 6,48 KOI8U to Latin/Hebrew */
  6844.     xw1lh,            /* 6,49 CP1252 to Latin/Hebrew */
  6845.     NULL,            /* 7,0 us ascii to Latin/Greek */
  6846.     NULL,            /* 7,1 uk ascii to Latin/Greek */
  6847.     xduas,            /* 7,2 dutch nrc to Latin/Greek */
  6848.     xfias,            /* 7,3 finnish nrc to Latin/Greek */
  6849.     xfras,            /* 7,4 french nrc to Latin/Greek */
  6850.     xfcas,            /* 7,5 french canadian nrc to Latin/Greek */
  6851.     xgeas,            /* 7,6 german nrc to Latin/Greek */
  6852.     xhuas,            /* 7,7 hungarian nrc to Latin/Greek */
  6853.     xitas,            /* 7,8 italian nrc to Latin/Greek */
  6854.     xnoas,            /* 7,9 norge/danish nrc to Latin/Greek */
  6855.     xpoas,            /* 7,10 portuguese nrc to Latin/Greek */
  6856.     xspas,            /* 7,11 spanish nrc to Latin/Greek */
  6857.     xswas,            /* 7,12 swedish nrc to Latin/Greek */
  6858.     xchas,            /* 7,13 swiss nrc to Latin/Greek */
  6859.     xl1lg,            /* 7,14 latin-1 to Latin/Greek */
  6860.     xl2lg,            /* 7,15 latin-2 to Latin/Greek */
  6861.     xl1lg,            /* 7,16 dec mcs to Latin/Greek */
  6862.     xneas,            /* 7,17 NeXT to Latin/Greek */
  6863.     xleft128,            /* 7,18 CP437 to Latin/Greek */
  6864.     x85as,            /* 7,19 CP850 to Latin/Greek */
  6865.     x52as,            /* 7,20 CP852 to Latin/Greek */
  6866.     xaqas,            /* 7,21 Macintosh Latin to Latin/Greek */
  6867.     xdgas,            /* 7,22 DGI to Latin/Greek */
  6868.     xr8as,            /* 7,23 HP to Latin/Greek */
  6869.     xleft160,                   /* 7,24 Latin/Cyrillic to Latin/Greek */
  6870.     xleft128,                   /* 7,25 CP866 to Latin/Greek */
  6871.     xskas,                      /* 7,26 Short KOI to Latin/Greek */
  6872.     xk8as,                      /* 7,27 Old KOI-8 Cyrillic to Latin/Greek */
  6873.     NULL,            /* 7,28 Kanji... */
  6874.     NULL,            /* 7,29 */
  6875.     NULL,            /* 7,30 */
  6876.     NULL,            /* 7,31 */
  6877.     xh7as,            /* 7,32 Hebrew-7 to Latin/Greek */
  6878.     NULL,            /* 7,33 Latin/Hebrew to Latin/Greek */
  6879.     x62as,            /* 7,34 CP862 Hebrew to Latin/Greek */
  6880.     xeglg,            /* 7,35 ELOT 927 Greek to Latin/Greek */
  6881.     NULL,            /* 7,36 Latin/Greek to Latin/Greek */
  6882.     x69lg,            /* 7,37 CP869 to Latin/Greek */
  6883.     xl1as,            /* 7,38 latin-9 to Latin/Greek */
  6884.     xl1as,            /* 7,39 latin-9 to Latin/Hebrew*/
  6885.     xleft128,            /* 7,40 CP855 to Latin/Greek */
  6886.     xleft128,            /* 7,41 CP1251 to Latin/Greek */
  6887.     xleft128,            /* 7,42 Bulgarian to Latin/Greek */
  6888.     x1250as,            /* 7,43 CP1250 to Latin/Greek */
  6889.     xmzas,            /* 7,44 Mazovia to Latin/Greek */
  6890.     NULL,            /* 7,45 UCS-2 to Latin/Greek */
  6891.     NULL,            /* 7,46 UTF-8 to Latin/Greek */
  6892.     NULL,            /* 7,47 KOI8R to Latin/Greek */
  6893.     NULL,            /* 7,48 KOI8U to Latin/Greek */
  6894.     xw1lg,            /* 7,49 CP1252 to Latin/Greek */
  6895.     NULL,            /* 8,0 us ascii to latin-9 */
  6896.     xukl1,            /* 8,1 uk ascii to latin-9 */
  6897.     xdul1,            /* 8,2 dutch nrc to latin-9 */
  6898.     xfil1,            /* 8,3 finnish nrc to latin-9 */
  6899.     xfrl1,            /* 8,4 french nrc to latin-9 */
  6900.     xfcl1,            /* 8,5 french canadian nrc to latin-9 */
  6901.     xgel1,            /* 8,6 german nrc to latin-9 */
  6902.     xhul1,            /* 8,7 hungarian nrc to latin-9 */
  6903.     xitl1,            /* 8,8 italian nrc to latin-9 */
  6904.     xnol1,            /* 8,9 norwegian/danish nrc to latin-9 */
  6905.     xpol1,            /* 8,10 portuguese nrc to latin-9 */
  6906.     xspl1,            /* 8,11 spanish nrc to latin-9 */
  6907.     xswl1,            /* 8,12 swedish nrc to latin-9 */
  6908.     xchl1,            /* 8,13 swiss nrc to latin-9 */
  6909.     NULL,            /* 8,14 latin-1 to latin-9 */
  6910.     xl2l9,            /* 8,15 latin-2 to latin-9 */
  6911.     xdml9,            /* 8,16 dec mcs to latin-9 */
  6912.     xnel9,                      /* 8,17 NeXT To Latin-9 */
  6913.     x43l1,                      /* 8,18 CP437 To Latin-9 */
  6914.     x85l1,                      /* 8,19 CP850 To Latin-9 */
  6915.     x52l1,                      /* 8,20 CP852 To Latin-9 */
  6916.     xaql1,                      /* 8,21 Macintosh Latin To Latin-9 */
  6917.     xdgl1,                      /* 8,22 DGI To Latin-9 */
  6918.     xr8l1,                      /* 8,23 HP To Latin-9 */
  6919.     xlcas,                      /* 8,24 Latin/Cyrillic To Latin-9 */
  6920.     xacas,                      /* 8,25 CP866 To Latin-9 */
  6921.     xskas,                      /* 8,26 Short KOI To Latin-9 */
  6922.     xk8as,                      /* 8,27 Old KOI-8 Cyrillic To Latin-9 */
  6923.     NULL,            /* 8,28 Kanji ... */
  6924.     NULL,            /* 8,29 */
  6925.     NULL,            /* 8,30 */
  6926.     NULL,            /* 8,31 */
  6927.     xh7as,            /* 8,32 Hebrew-7 To Latin-9 */
  6928.     xlhl1,            /* 8,33 Latin/Hebrew To Latin-9 */
  6929.     x62l1,            /* 8,34 CP862 Hebrew To Latin-9 */
  6930.     xegas,            /* 8,35 ELOT 927 Greek To Latin-9 */
  6931.     xlgl1,            /* 8,36 Latin/Greek To Latin-9 */
  6932.     xl169,            /* 8,37 CP869 To Latin-9 */
  6933.     NULL,            /* 8,38 Latin-9 To Latin-9 */
  6934.     x58l9,            /* 8,39 cp858 To Latin-9 */
  6935.     x55as,            /* 8,40 cp855 To Latin-9 */
  6936.     x55as,            /* 8,41 cp1251 To Latin-9 */
  6937.     xleft128,            /* 8,42 Bulgarian To Latin-9 */
  6938.     x1250l9,            /* 8,43 CP1250 To Latin-9 */
  6939.     xmzl9,            /* 8,44 Mazovia To Latin-9 */
  6940.     NULL,            /* 8,45 UCS-2 to Latin-9 */
  6941.     NULL,            /* 8,46 UTF-8 to Latin-9 */
  6942.     NULL,            /* 8,47 KOI8R to Latin-9 */
  6943.     NULL,            /* 8,48 KOI8U to Latin-9 */
  6944.     xw1l9,            /* 8,49 CP1252 to Latin-9 */
  6945.     NULL,            /* 9,00 Unicode... */
  6946.     NULL,            /* 9,01 */
  6947.     NULL,            /* 9,02 */
  6948.     NULL,            /* 9,03 */
  6949.     NULL,            /* 9,04 */
  6950.     NULL,            /* 9,05 */
  6951.     NULL,            /* 9,06 */
  6952.     NULL,            /* 9,07 */
  6953.     NULL,            /* 9,08 */
  6954.     NULL,            /* 9,09 */
  6955.     NULL,            /* 9,10 */
  6956.     NULL,            /* 9,11 */
  6957.     NULL,            /* 9,12 */
  6958.     NULL,            /* 9,13 */
  6959.     NULL,            /* 9,14 */
  6960.     NULL,            /* 9,15 */
  6961.     NULL,            /* 9,16 */
  6962.     NULL,            /* 9,17 */
  6963.     NULL,            /* 9,18 */
  6964.     NULL,            /* 9,19 */
  6965.     NULL,            /* 9,20 */
  6966.     NULL,            /* 9,21 */
  6967.     NULL,            /* 9,22 */
  6968.     NULL,            /* 9,23 */
  6969.     NULL,            /* 9,24 */
  6970.     NULL,            /* 9,25 */
  6971.     NULL,            /* 9,26 */
  6972.     NULL,            /* 9,27 */
  6973.     NULL,            /* 9,28 */
  6974.     NULL,            /* 9,29 */
  6975.     NULL,            /* 9,30 */
  6976.     NULL,            /* 9,31 */
  6977.     NULL,            /* 9,32 */
  6978.     NULL,            /* 9,33 */
  6979.     NULL,            /* 9,34 */
  6980.     NULL,            /* 9,35 */
  6981.     NULL,            /* 9,36 */
  6982.     NULL,            /* 9,37 */
  6983.     NULL,            /* 9,38 */
  6984.     NULL,            /* 9,39 */
  6985.     NULL,            /* 9,40 */
  6986.     NULL,            /* 9,41 */
  6987.     NULL,            /* 9,42 */
  6988.     NULL,            /* 9,43 */
  6989.     NULL,            /* 9,44 */
  6990.     NULL,            /* 9,45 */
  6991.     NULL,            /* 9,46 */
  6992.     NULL,            /* 9,47 */
  6993.     NULL,            /* 9,48 */
  6994.     NULL,            /* 9,49 */
  6995.     NULL,            /* 10,00 */
  6996.     NULL,            /* 10,01 */
  6997.     NULL,            /* 10,02 */
  6998.     NULL,            /* 10,03 */
  6999.     NULL,            /* 10,04 */
  7000.     NULL,            /* 10,05 */
  7001.     NULL,            /* 10,06 */
  7002.     NULL,            /* 10,07 */
  7003.     NULL,            /* 10,08 */
  7004.     NULL,            /* 10,09 */
  7005.     NULL,            /* 10,10 */
  7006.     NULL,            /* 10,11 */
  7007.     NULL,            /* 10,12 */
  7008.     NULL,            /* 10,13 */
  7009.     NULL,            /* 10,14 */
  7010.     NULL,            /* 10,15 */
  7011.     NULL,            /* 10,16 */
  7012.     NULL,            /* 10,17 */
  7013.     NULL,            /* 10,18 */
  7014.     NULL,            /* 10,19 */
  7015.     NULL,            /* 10,20 */
  7016.     NULL,            /* 10,21 */
  7017.     NULL,            /* 10,22 */
  7018.     NULL,            /* 10,23 */
  7019.     NULL,            /* 10,24 */
  7020.     NULL,            /* 10,25 */
  7021.     NULL,            /* 10,26 */
  7022.     NULL,            /* 10,27 */
  7023.     NULL,            /* 10,28 */
  7024.     NULL,            /* 10,29 */
  7025.     NULL,            /* 10,30 */
  7026.     NULL,            /* 10,31 */
  7027.     NULL,            /* 10,32 */
  7028.     NULL,            /* 10,33 */
  7029.     NULL,            /* 10,34 */
  7030.     NULL,            /* 10,35 */
  7031.     NULL,            /* 10,36 */
  7032.     NULL,            /* 10,37 */
  7033.     NULL,            /* 10,38 */
  7034.     NULL,            /* 10,39 */
  7035.     NULL,            /* 10,40 */
  7036.     NULL,            /* 10,41 */
  7037.     NULL,            /* 10,42 */
  7038.     NULL,            /* 10,43 */
  7039.     NULL,            /* 10,44 */
  7040.     NULL,            /* 10,45 */
  7041.     NULL,            /* 10,46 */
  7042.     NULL,            /* 10,47 */
  7043.     NULL,            /* 10,48 */
  7044.     NULL            /* 10,49 */
  7045. };
  7046. int nxls = (sizeof(xls) / sizeof(CHAR *));
  7047.  
  7048. #ifndef NOLOCAL
  7049. /*
  7050.   The following routines are useful only for terminal character sets, and so
  7051.   ifdef'd out for NOLOCAL compilations.
  7052. */
  7053.  
  7054. /*
  7055.   C S _ I S _ N R C
  7056.  
  7057.   Returns nonzero if argument indicates a 7-bit national character set,
  7058.   zero otherwise.
  7059. */
  7060. int
  7061. cs_is_nrc(x) int x; {
  7062. #ifdef UNICODE
  7063.     if (x == TX_J201R || x == TX_DECSPEC || x == TX_DECTECH
  7064.         || txrinfo[x] == NULL)
  7065.       return(0);
  7066.     else
  7067.       return(txrinfo[x]->flags & X2U_STD && txrinfo[x]->size == 94);
  7068. #else /* UNICODE */
  7069.     if ((cs_size(x) == 94))
  7070.       return(1);
  7071.     else
  7072.       return(0);
  7073. #endif /* UNICODE */
  7074. }
  7075.  
  7076. /*
  7077.   C S _ I S _ S T D
  7078.  
  7079.   Returns nonzero if argument indicates an ISO 4873-standard-format
  7080.   character set, i.e. one in which the control region is NOT used for
  7081.   graphics; zero otherwise.
  7082. */
  7083. int
  7084. cs_is_std(x) int x; {
  7085. #ifdef UNICODE
  7086.     if (!txrinfo[x])            /* Even more safety */
  7087.       return(0);
  7088.     else if (txrinfo[x]->size == 128)    /* Just for safety */
  7089.       return(0);
  7090.     else
  7091.       return(txrinfo[x]->flags & X2U_STD); /* Only this should be needed */
  7092. #else
  7093.     switch (x) {
  7094.       case FC_CP437:            /* Code pages use C1 graphics */
  7095.       case FC_CP850:
  7096.       case FC_CP852:
  7097.       case FC_CP862:
  7098.       case FC_CP866:
  7099.       case FC_CP869:
  7100.       case FC_CP858:
  7101.       case FC_APPQD:            /* So do Apple and NeXTSTEP */
  7102.       case FC_NEXT:
  7103.     return(0);
  7104.       default:                /* Others behave */
  7105.     return(1);
  7106.     }
  7107. #endif /* CKOUINI */
  7108. }
  7109.  
  7110. int
  7111. cs_size(x) int x; {
  7112. #ifdef UNICODE
  7113.     if (!txrinfo[x])
  7114.       return(128);
  7115.     return(txrinfo[x]->size);
  7116. #else
  7117.     switch(x) {
  7118.       case FC_USASCII:
  7119.       case FC_UKASCII:
  7120.       case FC_DUASCII:
  7121.       case FC_FIASCII:
  7122.       case FC_FRASCII:
  7123.       case FC_FCASCII:
  7124.       case FC_GEASCII:
  7125.       case FC_HUASCII:
  7126.       case FC_ITASCII:
  7127.       case FC_NOASCII:
  7128.       case FC_POASCII:
  7129.       case FC_SPASCII:
  7130.       case FC_SWASCII:
  7131.       case FC_CHASCII:
  7132.       case FC_KOI7:
  7133.       case FC_HE7:
  7134.       case FC_ELOT:
  7135.     return(94);
  7136.  
  7137.       case FC_1LATIN:
  7138.       case FC_2LATIN:
  7139.       case FC_DECMCS:
  7140.       case FC_DGMCS:
  7141.       case FC_HPR8:
  7142.       case FC_CYRILL:
  7143.       case FC_KOI8:
  7144.       case FC_HEBREW:
  7145.       case FC_GREEK:
  7146.       case FC_9LATIN:
  7147.     return(96);
  7148.  
  7149.       case FC_NEXT:
  7150.       case FC_CP437:
  7151.       case FC_CP850:
  7152.       case FC_CP852:
  7153.       case FC_CP855:
  7154.       case FC_CP862:
  7155.       case FC_CP866:
  7156.       case FC_CP1251:
  7157.       case FC_APPQD:
  7158.     return(128);
  7159. #ifdef KANJI
  7160.       case FC_JIS7:
  7161.     return(-94);
  7162.       case FC_SHJIS:
  7163.     return(-128);
  7164.       case FC_JEUC:
  7165.       case FC_JDEC:
  7166.     return(-96);
  7167. #endif /* KANJI */
  7168.       case FC_CP858:
  7169.       default:
  7170.     return(-1);
  7171.     }
  7172. #endif /* UNICODE */
  7173. }
  7174. #endif /* NOLOCAL */
  7175.  
  7176. /*
  7177.   S E T X L A T Y P E  --  Set Translation Type
  7178.  
  7179.   Sets global xlatype to indicate which kind of translation:
  7180.  
  7181.     XLA_NONE      No translation
  7182.     XLA_BYTE      Byte-for-Byte translation
  7183.     XLA_JAPAN     Japanese Kanji translation
  7184.     XLA_UNICODE   Unicode translations
  7185.  
  7186.   And sets up the appropriate translation function pointers as follows:
  7187.  
  7188.   For no translation:
  7189.     All function pointers are NULL.
  7190.  
  7191.   For Byte-for-Byte transation:
  7192.     rx  = TCS to FCS (these functions are in this module...)
  7193.     sx  = FCS to TCS
  7194.  
  7195.   For Unicode translations:
  7196.     xfu = FCS to UCS (these functions are in ckcuni.c...)
  7197.     xtu = TCS to UCS
  7198.     xuf = UCS to FCS
  7199.     xut = UCS to TCS
  7200. */
  7201. VOID
  7202. setxlatype(tcs, fcs) int tcs, fcs; {
  7203. #ifdef UNICODE
  7204.     xfu = NULL;                /* Unicode <-> TCS/FCS functions */
  7205.     xtu = NULL;
  7206.     xuf = NULL;
  7207.     xut = NULL;
  7208. #endif /* UNICODE */
  7209.     rx = sx = NULL;
  7210.     debug(F101,"setxlatype fcs","",fcs);
  7211.     debug(F101,"setxlatype tcs","",tcs);
  7212.  
  7213.     if (tcs < 0 || tcs > MAXTCSETS) {
  7214.     debug(F101,"setxlatype bad tcs","",tcs);
  7215.     return;
  7216.     }
  7217.     if (fcs < 0 || fcs > MAXFCSETS) {
  7218.     debug(F101,"setxlatype bad fcs","",fcs);
  7219.     return;
  7220.     }
  7221.     if (tcs == TC_TRANSP || xfrxla == 0) { /* Transfer charset TRANSPARENT */
  7222.     debug(F101,"setxlatype transparent because TCS==Transparent","",tcs);
  7223.     xlatype = XLA_NONE;        /* Translation type is None */
  7224. #ifdef UNICODE
  7225.     /* If any of our charsets is Unicode we use Unicode functions */
  7226.     /* even if TCS and FCS are the same because of BOM and byte swapping */
  7227.     } else if (tcs == TC_UCS2 || tcs == TC_UTF8 ||
  7228.            fcs == FC_UCS2 || fcs == FC_UTF8) {
  7229.     debug(F101,"setxlatype Unicode tcs","",tcs);
  7230.     debug(F101,"setxlatype Unicode fcs","",fcs);
  7231.     /* Unicode <-> TCS/FCS functions */
  7232.     xfu = xl_fcu[fcs];        /* FCS -> UCS */
  7233.     xtu = xl_tcu[tcs];        /* TCS -> UCS */
  7234.     xuf = xl_ufc[fcs];        /* UCS -> FCS */
  7235.     xut = xl_utc[tcs];        /* UCS -> TCS */
  7236.         xlatype = XLA_UNICODE;        /* Translation type is Unicode */
  7237. #ifdef COMMENT
  7238.     /* These make trouble in 64-bit land */
  7239.     debug(F001,"setxlatype Unicode xfu","",(unsigned)xfu);
  7240.     debug(F001,"setxlatype Unicode xuf","",(unsigned)xuf);
  7241. #endif /* COMMENT */
  7242. #endif /* UNICODE */
  7243.     } else if (cseqtab[tcs] == fcs) {    /* Or if TCS == FCS */
  7244.     debug(F101,"setxlatype transparent because TCS==FCS","",tcs);
  7245.     xlatype = XLA_NONE;        /* translation type is also None */
  7246. #ifdef KANJI
  7247.     /* Otherwise if any of them is Japanese, we use Kanji functions */
  7248.     } else if (tcs == TC_JEUC || fcsinfo[fcs].alphabet == AL_JAPAN) {
  7249.     debug(F101,"setxlatype Japanese tcs","",tcs);
  7250.     debug(F101,"setxlatype Japanese fcs","",fcs);
  7251.         xlatype = XLA_JAPAN;        /* Translation type is Japanese */
  7252. #endif /* KANJI */
  7253.     /* Otherwise we use byte functions */
  7254.     } else {                /* Otherwise... */
  7255.     rx = xlr[tcs][fcs];        /* Input translation function */
  7256.     sx = xls[tcs][fcs];        /* Output translation function */
  7257.     debug(F101,"setxlatype Byte tcs","",tcs);
  7258.     debug(F101,"setxlatype Byte fcs","",fcs);
  7259.         xlatype = XLA_BYTE;        /* Translation type is Byte */
  7260.     }
  7261.     debug(F101,"setxlatype xlatype","",xlatype);
  7262. }
  7263.  
  7264. /* Set up translation between two file character sets with UCS intermediate */
  7265.  
  7266. #ifdef UNICODE
  7267. VOID
  7268. initxlate(csin, csout) int csin, csout; {
  7269.     xfu = NULL;
  7270.     xtu = NULL;
  7271.     xuf = NULL;
  7272.     xut = NULL;
  7273.  
  7274.     debug(F101,"initxlate csin","",csin);
  7275.     debug(F101,"initxlate csout","",csout);
  7276.  
  7277.     if (csin < 0 || csin > MAXFCSETS) {
  7278.     debug(F101,"initxlate bad csin","",csin);
  7279.     return;
  7280.     }
  7281.     if (csout < 0 || csout > MAXFCSETS) {
  7282.     debug(F101,"initxlate bad csout","",csout);
  7283.     return;
  7284.     }
  7285.     if (csin == csout && csin != FC_UCS2) {
  7286.     xlatype = XLA_NONE;        /* Translation type is None */
  7287.     return;
  7288.     }
  7289.     xlatype = XLA_UNICODE;        /* Translation type is Unicode */
  7290.     xfu = xl_fcu[csin];            /* FCS -> UCS */
  7291.     xuf = xl_ufc[csout];        /* UCS -> FCS */
  7292.     xpnbyte(-1,0,0,NULL);        /* Reset UCS-2 */
  7293. #ifdef COMMENT
  7294.     debug(F001,"initxlate Unicode xfu","",(unsigned)xfu);
  7295.     debug(F001,"initxlate Unicode xuf","",(unsigned)xuf);
  7296. #endif /* COMMENT */
  7297.     debug(F101,"initxlate xlatype","",xlatype);
  7298. }
  7299. #endif /* UNICODE */
  7300.  
  7301. int csetsinited = 0;
  7302.  
  7303. VOID
  7304. initcsets() {                /* Routine to reset or initialize */
  7305.     int i;                /* character-set associations. */
  7306.  
  7307. #ifdef UNICODE
  7308.     if (ucsorder < 0)            /* For creating UCS-2 files. */
  7309.       ucsorder = byteorder;
  7310.     if (ucsorder < 0)
  7311.       ucsorder = 0;
  7312.     if (fileorder < 0)            /* For reading UCS-2 files. */
  7313.       fileorder = ucsorder;
  7314. #endif /* UNICODE */
  7315.  
  7316.     debug(F101,"initcsets nxls","",nxls);
  7317.     debug(F101,"initcsets nxlr","",nxlr);
  7318.  
  7319.     debug(F101,"initcsets TERM LOCAL CSET","",tcsl);
  7320.     debug(F101,"initcsets TERM REMOTE CSET","",tcsr);
  7321.  
  7322.     for (i = 0; i <= MAXFCSETS; i++)    /* First clear them all... */
  7323.       afcset[i] = -1;
  7324.     for (i = 0; i <= MAXTCSETS; i++)
  7325.       axcset[i] = -1;
  7326.  
  7327.     /* Now set specific defaults for incoming files */
  7328.  
  7329.     xlatype = XLA_NONE;
  7330.  
  7331.     axcset[TC_TRANSP]  = FC_TRANSP;
  7332.     axcset[TC_USASCII] = FC_USASCII;
  7333.  
  7334. #ifdef OS2
  7335.     switch (fcharset) {
  7336.       case FC_CP850:
  7337.       case FC_CP858:
  7338.       case FC_CP437:
  7339.       case FC_1LATIN:
  7340.     axcset[TC_1LATIN]  = fcharset;
  7341.     break;
  7342.       default:
  7343.     axcset[TC_1LATIN]  = FC_CP850;
  7344.     }
  7345. #else
  7346. #ifdef HPUX
  7347.     axcset[TC_1LATIN]  = FC_HPR8;
  7348. #else
  7349. #ifdef VMS
  7350.     axcset[TC_1LATIN]  = FC_DECMCS;
  7351. #else
  7352. #ifdef NEXT
  7353.     axcset[TC_1LATIN]  = FC_NEXT;
  7354. #else
  7355. #ifdef datageneral
  7356.     axcset[TC_1LATIN]  = FC_DGMCS;
  7357. #else
  7358.     /* Should we use code pages on some PC based UNIXes? */
  7359.     axcset[TC_1LATIN]  = FC_1LATIN;
  7360. #endif /* datageneral */
  7361. #endif /* NEXT */
  7362. #endif /* VMS */
  7363. #endif /* HPUX */
  7364. #endif /* OS2 */
  7365.  
  7366. #ifdef OS2
  7367.     axcset[TC_2LATIN]  = FC_CP852;
  7368.     axcset[TC_CYRILL]  = FC_CP866;
  7369.     axcset[TC_JEUC]    = FC_SHJIS;
  7370.     axcset[TC_HEBREW]  = FC_CP862;
  7371.     axcset[TC_GREEK]   = FC_CP869;
  7372.     axcset[TC_9LATIN]  = FC_CP858;
  7373.     axcset[TC_UCS2]    = FC_UCS2;
  7374.     axcset[TC_UTF8]    = FC_UCS2;
  7375. #else
  7376.     axcset[TC_2LATIN]  = FC_2LATIN;
  7377.     axcset[TC_CYRILL]  = FC_CYRILL;
  7378.     axcset[TC_JEUC]    = FC_JEUC;
  7379.     axcset[TC_HEBREW]  = FC_HEBREW;
  7380.     axcset[TC_GREEK]   = FC_GREEK;
  7381.     axcset[TC_9LATIN]  = FC_9LATIN;
  7382.     axcset[TC_UCS2]    = FC_UTF8;
  7383.     axcset[TC_UTF8]    = FC_UTF8;
  7384. #endif /* OS2 */
  7385.  
  7386.     /* And for outbound files */
  7387.  
  7388.     afcset[FC_USASCII] = TC_USASCII;
  7389.     afcset[FC_UKASCII] = TC_1LATIN;
  7390.     afcset[FC_DUASCII] = TC_1LATIN;
  7391.     afcset[FC_FIASCII] = TC_1LATIN;
  7392.     afcset[FC_FRASCII] = TC_1LATIN;
  7393.     afcset[FC_FCASCII] = TC_1LATIN;
  7394.     afcset[FC_GEASCII] = TC_1LATIN;
  7395.     afcset[FC_HUASCII] = TC_2LATIN;
  7396.     afcset[FC_ITASCII] = TC_1LATIN;
  7397.     afcset[FC_NOASCII] = TC_1LATIN;
  7398.     afcset[FC_POASCII] = TC_1LATIN;
  7399.     afcset[FC_SPASCII] = TC_1LATIN;
  7400.     afcset[FC_SWASCII] = TC_1LATIN;
  7401.     afcset[FC_CHASCII] = TC_1LATIN;
  7402.     afcset[FC_1LATIN]  = TC_1LATIN;
  7403.     afcset[FC_2LATIN]  = TC_2LATIN;
  7404.     afcset[FC_DECMCS]  = TC_1LATIN;
  7405.     afcset[FC_NEXT]    = TC_1LATIN;
  7406.     afcset[FC_CP437]   = TC_1LATIN;
  7407.     afcset[FC_CP850]   = TC_1LATIN;
  7408.     afcset[FC_CP852]   = TC_2LATIN;
  7409.     afcset[FC_APPQD]   = TC_1LATIN;
  7410.     afcset[FC_DGMCS]   = TC_1LATIN;
  7411.     afcset[FC_HPR8]    = TC_1LATIN;
  7412.     afcset[FC_CYRILL]  = TC_CYRILL;
  7413.     afcset[FC_CP866]   = TC_CYRILL;
  7414.     afcset[FC_KOI7]    = TC_CYRILL;
  7415.     afcset[FC_KOI8]    = TC_CYRILL;
  7416.     afcset[FC_JIS7]    = TC_JEUC;
  7417.     afcset[FC_SHJIS]   = TC_JEUC;
  7418.     afcset[FC_JEUC]    = TC_JEUC;
  7419.     afcset[FC_JDEC]    = TC_JEUC;
  7420.     afcset[FC_HE7]     = TC_HEBREW;
  7421.     afcset[FC_HEBREW]  = TC_HEBREW;
  7422.     afcset[FC_CP862]   = TC_HEBREW;
  7423.     afcset[FC_ELOT]    = TC_GREEK;
  7424.     afcset[FC_GREEK]   = TC_GREEK;
  7425.     afcset[FC_CP869]   = TC_GREEK;
  7426.     afcset[FC_9LATIN]  = TC_9LATIN;
  7427.     afcset[FC_CP923]   = TC_9LATIN;
  7428.     afcset[FC_CP858]   = TC_9LATIN;
  7429.     afcset[FC_CP855]   = TC_CYRILL;
  7430.     afcset[FC_CP1251]  = TC_CYRILL;
  7431.     afcset[FC_BULGAR]  = TC_CYRILL;
  7432.     afcset[FC_CP1250]  = TC_2LATIN;
  7433.     afcset[FC_MAZOVIA] = TC_2LATIN;
  7434.     afcset[FC_UCS2]    = TC_UTF8;
  7435.     afcset[FC_UTF8]    = TC_UTF8;
  7436.  
  7437.     afcset[FC_KOI8R]   = TC_CYRILL;
  7438.     afcset[FC_KOI8U]   = TC_CYRILL;
  7439.     afcset[FC_CP1252]  = TC_1LATIN;
  7440.  
  7441.     csetsinited++;
  7442.     return;
  7443. }
  7444. #endif /* NOCSETS */
  7445.