home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckc190.zip / ckuxla.c < prev    next >
C/C++ Source or Header  |  1994-08-08  |  184KB  |  4,600 lines

  1. #include "ckcsym.h"
  2. #ifndef NOCSETS
  3. char *xlav = "Character Set Translation 5A(022), 24 Jan 94";
  4.  
  5. /*  C K U X L A  */
  6.  
  7. /*  C-Kermit tables and functions supporting character set translation.  */
  8. /*
  9.   Author: Frank da Cruz (fdc@columbia.edu, FDCCU@CUVMA.BITNET),
  10.   Columbia University Academic Information Systems, New York City.
  11.  
  12.   Copyright (C) 1985, 1994, Trustees of Columbia University in the City of New
  13.   York.  The C-Kermit software may not be, in whole or in part, licensed or
  14.   sold for profit as a software product itself, nor may it be included in or
  15.   distributed with commercial products or otherwise distributed by commercial
  16.   concerns to their clients or customers without written permission of the
  17.   Office of Kermit Development and Distribution, Columbia University.  This
  18.   copyright notice must not be removed, altered, or obscured.
  19. */
  20.  
  21. /*
  22.   CAVEAT PROGRAMMATOR: The mechanism used herein turns out to be somewhat
  23.   inflexible and maybe a little dangerous.  It is designed for Kermit's
  24.   character-at-a-time processing during protocol operations.  Elaborate
  25.   kludges are used for translating one character into two (like stuffing an
  26.   extra character into the input stream), or two into one, or two into two.
  27.  
  28.   The whole translation business might be redesigned to be string-oriented
  29.   rather than character oriented, so (a) we can have more flexible
  30.   translations, and (b) we don't have to be concerned about which input stream
  31.   we are using.  The current mechanism is also quite inappropriate
  32.   for multibyte character sets and for flexible user-defined translations.
  33.  
  34.   For the future: perhaps it would be better to represent characters
  35.   internally using a universal character set like UNICODE (ISO 10646 BMP),
  36.   the ultimate "transfer character set" (or not)...
  37. */
  38. #include "ckcdeb.h"            /* Includes... */
  39. #include "ckcker.h"
  40. #include "ckucmd.h"
  41. #include "ckcxla.h"
  42.  
  43. /* Character set translation data and functions */
  44.  
  45. extern int zincnt;            /* File i/o macros and variables */
  46. extern char *zinptr;
  47. extern int zoutcnt;
  48. extern char *zoutptr;
  49.  
  50. int tslevel  = TS_L0;            /* Transfer syntax level (0,1,2) */
  51. int tcharset = TC_TRANSP;        /* Transfer syntax character set */
  52. int tcsr     = FC_USASCII;        /* Remote terminal character set */
  53. int language = L_USASCII;        /* Language */
  54.  
  55. /*
  56.   Default local file and terminal character set.
  57.   Normally ASCII, but for some systems we know otherwise.
  58. */
  59. #ifdef datageneral            /* Data General AOS/VS */
  60. int fcharset = FC_DGMCS;        /* uses the DG International set */
  61. int tcsl     = FC_DGMCS;
  62. #else
  63. #ifdef NEXT                /* The NeXT workstation */
  64. int fcharset = FC_NEXT;            /* uses its own 8-bit set */
  65. int tcsl     = FC_NEXT;
  66. #else
  67. #ifdef MAC                /* The Macintosh */
  68. int fcharset = FC_APPQD;        /* uses an extended version of */
  69. int tcsl     = FC_APPQD;        /* Apple Quickdraw */
  70. #else
  71. #ifdef AUX
  72. int fcharset = FC_APPQD;        /* Ditto for Apple A/UX */
  73. int tcsl     = FC_APPQD;
  74. #else
  75. #ifdef AMIGA                /* The Commodore Amiga */
  76. int fcharset = FC_1LATIN;        /* uses Latin-1 */
  77. int tcsl     = FC_1LATIN;
  78. #else                    /* All others */
  79. int fcharset = FC_USASCII;        /* use ASCII by default */
  80. int tcsl     = FC_USASCII;
  81. #endif /* AMIGA */
  82. #endif /* AUX */
  83. #endif /* MAC */
  84. #endif /* NEXT */
  85. #endif /* datageneral */
  86.  
  87. /* Bureaucracy section */
  88.  
  89. _PROTOTYP( CHAR xnel1, (CHAR c) );    /* NeXT to Latin-1 */
  90. _PROTOTYP( CHAR xl143, (CHAR c) );    /* Latin-1 to IBM CP437 */
  91. _PROTOTYP( CHAR xl1as, (CHAR c) );    /* Latin-1 to US ASCII */
  92. _PROTOTYP( CHAR zl1as, (CHAR c) );    /* Latin-1 to US ASCII */
  93.  
  94. #ifdef CYRILLIC
  95. _PROTOTYP( CHAR xassk, (CHAR c) );    /* ASCII to Short KOI */
  96. _PROTOTYP( CHAR xskcy, (CHAR c) );    /* Short KOI to Latin/Cyrillic */
  97. #endif /* CYRILLIC */
  98.  
  99. #ifdef LATIN2
  100. _PROTOTYP( CHAR xnel2, (CHAR c) );    /* NeXT to Latin-2 */
  101. _PROTOTYP( CHAR xl243, (CHAR c) );    /* Latin-2 to IBM CP437 */
  102. _PROTOTYP( CHAR xl2as, (CHAR c) );    /* Latin-2 to US ASCII */
  103. _PROTOTYP( CHAR zl2as, (CHAR c) );    /* Latin-2 to US ASCII */
  104. _PROTOTYP( CHAR xl2r8, (CHAR c) );    /* Latin-2 to HP */
  105. #endif /* LATIN2 */
  106.  
  107. /* Transfer character-set info */
  108.  
  109. struct csinfo tcsinfo[] = {
  110. /*  Name              size code      designator alphabet keyword            */
  111.   "TRANSPARENT",       256,TC_TRANSP, "",      AL_UNK,  "transparent", /* 0 */
  112.   "ASCII",             128,TC_USASCII,"",      AL_ROMAN,"ascii",       /* 1 */
  113.   "LATIN1, ISO 8859-1",256,TC_1LATIN, "I6/100",AL_ROMAN,"latin1-iso",  /* 2 */
  114. #ifdef LATIN2
  115.   "LATIN2, ISO 8859-2",256,TC_2LATIN, "I6/101",AL_ROMAN,"latin2-iso",  /* 3 */
  116. #endif /* LATIN2 */
  117. #ifdef CYRILLIC
  118.   "CYRILLIC, ISO 8859-5",256,TC_CYRILL,"I6/144",AL_CYRIL,"cyrillic-iso",/* 4 */
  119. #endif /* CYRILLIC */
  120. #ifdef KANJI
  121.   "KANJI (EUC)", 16384,TC_JEUC,  "I14/87/13", AL_JAPAN, "japanese-euc", /* 5 */
  122. #endif /* KANJI */
  123. #ifdef HEBREW
  124.   "HEBREW, ISO 8859-8",256,TC_HEBREW,"I6/138",AL_HEBREW,"hebrew-iso"    /* 6 */
  125. #endif /* HEBREW */
  126. };
  127. int ntcsets = (sizeof(tcsinfo) / sizeof(struct csinfo));
  128.  
  129. struct keytab tcstab[] = {        /* Keyword table for */
  130.     "ascii",         TC_USASCII, 0,    /* SET TRANSFER CHARACTER-SET */
  131. #ifdef CYRILLIC
  132.     "cyrillic-iso",  TC_CYRILL,  0,
  133. #endif /* CYRILLIC */
  134. #ifdef HEBREW
  135.     "hebrew-iso",    TC_HEBREW,  0,
  136. #endif /* HEBREW */
  137. #ifdef KANJI
  138.     "japanese-euc",  TC_JEUC,    0,
  139. #endif /* KANJI */
  140. #ifdef LATIN2
  141. /*
  142.   If Latin-2 is defined, let the following be invisible, non-unique
  143.   abbreviations for LATIN1.
  144. */
  145.     "l",             TC_1LATIN,  CM_ABR|CM_INV,
  146.     "la",            TC_1LATIN,  CM_ABR|CM_INV,
  147.     "lat",           TC_1LATIN,  CM_ABR|CM_INV,
  148.     "lati",          TC_1LATIN,  CM_ABR|CM_INV,
  149.     "latin",         TC_1LATIN,  CM_ABR|CM_INV,
  150. #endif /* LATIN2 */
  151.     "latin1-iso",    TC_1LATIN,  0,
  152. #ifdef LATIN2
  153.     "latin2-iso",    TC_2LATIN,  0,
  154. #endif /* LATIN2 */
  155.     "transparent",   TC_TRANSP,  0
  156. };
  157. int ntcs = (sizeof(tcstab) / sizeof(struct keytab));
  158.  
  159. /* File character set information structure, indexed by character set code, */
  160. /* as defined in ckuxla.h.  This table must be in order of file character */
  161. /* set number! */ 
  162.  
  163. struct csinfo fcsinfo[] = { /* File character set information... */
  164.   /* Descriptive Name              Size  Designator */
  165.   "US ASCII",                     128, FC_USASCII, NULL, AL_ROMAN, "ascii",
  166.   "British/UK ISO-646",           128, FC_UKASCII, NULL, AL_ROMAN, "british",
  167.   "Dutch ISO-646",                128, FC_DUASCII, NULL, AL_ROMAN, "dutch",
  168.   "Finnish ISO-646",              128, FC_FIASCII, NULL, AL_ROMAN, "finnish",
  169.   "French ISO-646",               128, FC_FRASCII, NULL, AL_ROMAN, "french",
  170.   "Canadian-French NRC", 128, FC_FCASCII, NULL, AL_ROMAN, "canadian-french",
  171.   "German ISO-646",               128, FC_GEASCII, NULL, AL_ROMAN, "german",
  172.   "Hungarian ISO-646",            128, FC_HUASCII, NULL, AL_ROMAN, "hungarian",
  173.   "Italian ISO-646",              128, FC_ITASCII, NULL, AL_ROMAN, "italian",
  174.   "Norwegian/Danish ISO-646",128,FC_NOASCII,NULL,AL_ROMAN,"norwegian/danish",
  175.   "Portuguese ISO-646",           128, FC_POASCII, NULL, AL_ROMAN,"portuguese",
  176.   "Spanish ISO-646",              128, FC_SPASCII, NULL, AL_ROMAN, "spanish",
  177.   "Swedish ISO-646",              128, FC_SWASCII, NULL, AL_ROMAN, "swedish",
  178.   "Swiss NRC",                    128, FC_CHASCII, NULL, AL_ROMAN, "swiss",
  179.   "ISO 8859-1 Latin-1",           256, FC_1LATIN,  NULL, AL_ROMAN,"latin1-iso",
  180. #ifdef LATIN2
  181.   "ISO 8859-2 Latin-2",           256, FC_2LATIN,  NULL, AL_ROMAN,"latin2-iso",
  182. #endif /* LATIN2 */
  183.   "DEC Multinational", 256,  FC_DECMCS, NULL,AL_ROMAN,"dec-multinational",
  184.   "NeXT Multinational", 256, FC_NEXT,   NULL,AL_ROMAN,"next-multinational",
  185.   "IBM Code Page 437",            256, FC_CP437,   NULL, AL_ROMAN,"cp437",
  186.   "IBM Code Page 850",            256, FC_CP850,   NULL, AL_ROMAN,"cp850",
  187. #ifdef LATIN2
  188.   "IBM Code Page 852",            256, FC_CP852,   NULL, AL_ROMAN,"cp852",
  189. #endif /* LATIN2 */
  190.   "Apple Macintosh Latin", 256, FC_APPQD,   NULL, AL_ROMAN,"macintosh-latin",
  191.   "Data General International",256,FC_DGMCS,NULL,AL_ROMAN,"dg-international",
  192.   "Hewlett Packard Roman8",    256, FC_HPR8,    NULL, AL_ROMAN, "hp-roman8"
  193. #ifdef CYRILLIC
  194. , "ISO 8859-5 Latin/Cyrillic", 256, FC_CYRILL,  NULL, AL_CYRIL,"cyrillic-iso",
  195.   "CP866 Cyrillic",           256, FC_CP866,   NULL, AL_CYRIL,"cp866",
  196.   "Short KOI",                 128, FC_KOI7,    NULL, AL_CYRIL,"short-koi",
  197.   "Old KOI-8 Cyrillic",        256, FC_KOI8,    NULL, AL_CYRIL,"koi8-cyrillic"
  198. #endif /* CYRILLIC */
  199. #ifdef KANJI
  200. , "Japanese JIS7",        256, FC_JIS7,    NULL, AL_JAPAN, "jis7-kanji",
  201.   "Japanese Shift JIS",      16384, FC_SHJIS,   NULL, AL_JAPAN, "shift-jis-kanji",
  202.   "Japanese EUC",      16384, FC_JEUC,    NULL, AL_JAPAN, "japanese-euc",
  203.   "Japanese DEC Kanji",      16384, FC_JDEC,    NULL, AL_JAPAN, "dec-kanji"
  204. #endif /* KANJI */
  205. #ifdef HEBREW
  206. , "Hebrew-7 DEC",           128, FC_HE7,     NULL, AL_HEBREW, "hebrew-7",
  207.   "ISO 8859-8 Latin/Hebrew",256, FC_HEBREW,  NULL, AL_HEBREW, "hebrew-iso",
  208.   "CP862 Hebrew",           256, FC_CP862,   NULL, AL_HEBREW, "cp862-hebrew"
  209. #endif /* HEBREW */
  210. };    
  211.  
  212. /* Local file character sets */
  213. /* Includes 7-bit National Replacement Character Sets of ISO 646 */
  214. /* Plus ISO Latin-1, DEC Multinational Character Set (MCS), NeXT char set */
  215.  
  216. struct keytab fcstab[] = { /* Keyword table for 'set file character-set' */
  217.  
  218. /*
  219.   IMPORTANT: This table is replicated below as ttcstab (terminal character 
  220.   set table).  The only differences are the addition of TRANSPARENT
  221.   and the removal of the Kanji sets, which are not supported yet.
  222.   If you make changes to this table, also change ttcstab.
  223. */
  224.  
  225. /* Keyword             Value       Flags */
  226.     "apple-quickdraw",    FC_APPQD,   CM_INV, /* Apple Quickdraw */
  227.     "ascii",              FC_USASCII, 0, /* ASCII */
  228.     "british",            FC_UKASCII, 0, /* British NRC */
  229.     "canadian-french",    FC_FCASCII, 0, /* French Canadian NRC */
  230.     "cp437",              FC_CP437,   0, /* PC CP437 */
  231.     "cp850",              FC_CP850,   0, /* PC CP850 */
  232. #ifdef LATIN2
  233.     "cp852",              FC_CP852,   0, /* PC CP852 */
  234. #endif /* LATIN2 */
  235. #ifdef HEBREW
  236.     "cp862-hebrew",       FC_CP862,   0, /* PC CP862 */
  237. #endif /* HEBREW */
  238. #ifdef CYRILLIC
  239.     "cp866-cyrillic",     FC_CP866,   0, /* CP866 Cyrillic */
  240.     "cyrillic-iso",       FC_CYRILL,  0, /* ISO Latin/Cyrillic Alphabet */
  241. #endif /* CYRILLIC */
  242.     "danish",             FC_NOASCII, 0, /* Norwegian and Danish NRC */
  243. #ifdef KANJI
  244.     "dec-kanji",          FC_JDEC,    0, /* Japanese DEC Kanji */
  245. #endif /* KANJI */
  246.     "dec-multinational",  FC_DECMCS,  0, /* DEC multinational character set */
  247.     "dg-international",   FC_DGMCS,   0, /* Data General multinational */
  248.     "dutch",              FC_DUASCII, 0, /* Dutch NRC */
  249.     "finnish",            FC_FIASCII, 0, /* Finnish NRC */
  250.     "french",             FC_FRASCII, 0, /* French NRC */
  251.     "fr-canadian",        FC_FCASCII, CM_INV, /* French Canadian NRC */
  252.     "german",             FC_GEASCII, 0, /* German NRC */
  253. #ifdef HEBREW
  254.     "he",                 FC_HEBREW,  CM_ABR|CM_INV,
  255.     "heb",                FC_HEBREW,  CM_ABR|CM_INV,
  256.     "hebr",               FC_HEBREW,  CM_ABR|CM_INV,
  257.     "hebre",              FC_HEBREW,  CM_ABR|CM_INV,
  258.     "hebrew",             FC_HEBREW,  CM_ABR|CM_INV,
  259.     "hebrew-7",           FC_HE7,     0, /* DEC 7-Bit Hebrew */
  260.     "hebrew-iso",         FC_HEBREW,  0, /* ISO Latin/Hebrew */
  261. #endif /* HEBREW */
  262.     "hp-roman8",          FC_HPR8,    0, /* Hewlett Packard Roman8 */
  263.     "hungarian",          FC_HUASCII, 0, /* Hungarian NRC */
  264.     "italian",            FC_ITASCII, 0, /* Italian NRC */
  265. #ifdef KANJI
  266.     "japanese-euc",       FC_JEUC,    0, /* Japanese EUC */
  267.     "jis7-kanji",         FC_JIS7,    0, /* Japanese JIS7 7bit code */
  268. #endif /* KANJI */
  269. #ifdef CYRILLIC
  270.     "koi8-cyrillic",      FC_KOI8,    0, /* Old KOI-8 Cyrillic */
  271. #endif /* CYRILLIC */
  272. #ifdef LATIN2
  273.     "l",                  FC_1LATIN,  CM_ABR|CM_INV,
  274.     "la",                 FC_1LATIN,  CM_ABR|CM_INV,
  275.     "lat",                FC_1LATIN,  CM_ABR|CM_INV,
  276.     "lati",               FC_1LATIN,  CM_ABR|CM_INV,
  277.     "latin",              FC_1LATIN,  CM_ABR|CM_INV,
  278. #endif /* LATIN2 */
  279.     "latin1-iso",         FC_1LATIN,  0, /* ISO Latin Alphabet 1 */
  280. #ifdef LATIN2
  281.     "latin2-iso",         FC_2LATIN,  0, /* ISO Latin Alphabet 2 */
  282. #endif /* LATIN2 */
  283.     "macintosh-latin",    FC_APPQD,   0, /* "Extended Mac Latin" */
  284.     "next-multinational", FC_NEXT,    0, /* NeXT workstation */
  285.     "norwegian",          FC_NOASCII, 0, /* Norwegian and Danish NRC */
  286.     "portuguese",         FC_POASCII, 0, /* Portuguese NRC */
  287. #ifdef KANJI
  288.     "shift-jis-kanji",    FC_SHJIS,   0, /* Japanese Kanji Shift-JIS */
  289. #endif /* KANJI */
  290. #ifdef CYRILLIC
  291.     "short-koi",          FC_KOI7,    0, /* Short KOI Cyrillic */
  292. #endif /* CYRILLIC */
  293.     "spanish",            FC_SPASCII, 0, /* Spanish NRC */
  294.     "swedish",            FC_SWASCII, 0, /* Swedish NRC */
  295.     "swiss",              FC_CHASCII, 0     /* Swiss NRC */
  296. };
  297. int nfilc = (sizeof(fcstab) / sizeof(struct keytab)); /* size of this table */
  298.  
  299.  
  300. struct keytab ttcstab[] = { /* Keyword table for SET TERMINAL CHARACTER-SET */
  301. /*
  302.   IMPORTANT: This table is a replica of fcstab, immediately above, with the
  303.   addition of TRANSPARENT.  If you make changes to this table, make the
  304.   corresponding changes to fcstab.
  305. */
  306. /* Keyword               Value       Flags */
  307.     "apple-quickdraw",    FC_APPQD,   CM_INV, /* Apple Quickdraw */
  308.     "ascii",              FC_USASCII, 0, /* ASCII */
  309.     "british",            FC_UKASCII, 0, /* British NRC */
  310.     "canadian-french",    FC_FCASCII, 0, /* French Canadian NRC */
  311.     "cp437",              FC_CP437,   0, /* IBM CP437 */
  312.     "cp850",              FC_CP850,   0, /* IBM CP850 */
  313. #ifdef LATIN2
  314.     "cp852",              FC_CP852,   0, /* IBM CP852 */
  315. #endif /* LATIN2 */
  316. #ifdef HEBREW
  317.     "cp862-hebrew",       FC_CP862,   0, /* PC CP862 */
  318. #endif /* HEBREW */
  319. #ifdef CYRILLIC
  320.     "cp866-cyrillic",     FC_CP866,   0, /* CP866 Cyrillic */
  321.     "cyrillic-iso",       FC_CYRILL,  0, /* ISO Latin/Cyrillic Alphabet */
  322. #endif /* CYRILLIC */
  323.     "danish",             FC_NOASCII, 0, /* Norwegian and Danish NRC */
  324. #ifdef COMMENT
  325. #ifdef KANJI
  326.     "dec-kanji",          FC_JDEC,    0, /* Japanese DEC Kanji */
  327. #endif /* KANJI */
  328. #endif /* COMMENT */
  329.     "dec-multinational",  FC_DECMCS,  0, /* DEC multinational character set */
  330.     "dg-international",   FC_DGMCS,   0, /* Data General multinational */
  331.     "dutch",              FC_DUASCII, 0, /* Dutch NRC */
  332.     "finnish",            FC_FIASCII, 0, /* Finnish NRC */
  333.     "french",             FC_FRASCII, 0, /* French NRC */
  334.     "fr-canadian",        FC_FCASCII, CM_INV, /* French Canadian NRC */
  335.     "german",             FC_GEASCII, 0, /* German NRC */
  336. #ifdef HEBREW
  337.     "he",                 FC_HEBREW,  CM_ABR|CM_INV,
  338.     "heb",                FC_HEBREW,  CM_ABR|CM_INV,
  339.     "hebr",               FC_HEBREW,  CM_ABR|CM_INV,
  340.     "hebre",              FC_HEBREW,  CM_ABR|CM_INV,
  341.     "hebrew",             FC_HEBREW,  CM_ABR|CM_INV,
  342.     "hebrew-7",           FC_HE7,     0, /* DEC 7-Bit Hebrew */
  343.     "hebrew-iso",         FC_HEBREW,  0, /* ISO Latin/Hebrew */
  344. #endif /* HEBREW */
  345.     "hp-roman8",          FC_HPR8,    0, /* Hewlett Packard Roman8 */
  346.     "hungarian",          FC_HUASCII, 0, /* Hungarian NRC */
  347.     "italian",            FC_ITASCII, 0, /* Italian NRC */
  348. #ifdef COMMENT
  349. /* Kanji terminal character sets not implemented yet */
  350. #ifdef KANJI
  351.     "japanese-euc",       FC_JEUC,    0, /* Japanese EUC */
  352.     "jis7-kanji",         FC_JIS7,    0, /* Japanese JIS7 7bit code */
  353. #endif /* KANJI */
  354. #endif /* COMMENT */
  355. #ifdef CYRILLIC
  356.     "koi8-cyrillic",      FC_KOI8,    0, /* Old KOI-8 Cyrillic */
  357. #endif /* CYRILLIC */
  358. #ifdef LATIN2
  359.     "l",                  FC_1LATIN,  CM_ABR|CM_INV,
  360.     "la",                 FC_1LATIN,  CM_ABR|CM_INV,
  361.     "lat",                FC_1LATIN,  CM_ABR|CM_INV,
  362.     "lati",               FC_1LATIN,  CM_ABR|CM_INV,
  363.     "latin",              FC_1LATIN,  CM_ABR|CM_INV,
  364. #endif /* LATIN2 */
  365.     "latin1-iso",         FC_1LATIN,  0, /* ISO Latin Alphabet 1 */
  366. #ifdef LATIN2
  367.     "latin2-iso",         FC_2LATIN,  0, /* ISO Latin Alphabet 2 */
  368. #endif /* LATIN2 */
  369.     "macintosh-latin",    FC_APPQD,   0, /* "Extended Mac Latin */
  370.     "next-multinational", FC_NEXT,    0, /* NeXT workstation */
  371.     "norwegian",          FC_NOASCII, 0, /* Norwegian and Danish NRC */
  372.     "portuguese",         FC_POASCII, 0, /* Portuguese NRC */
  373. #ifdef COMMENT
  374. /* Kanji terminal character sets not implemented yet. */
  375. #ifdef KANJI
  376.     "shift-jis-kanji",    FC_SHJIS,   0, /* Japanese Kanji Shift-JIS */
  377. #endif /* KANJI */
  378. #endif /* COMMENT */
  379. #ifdef CYRILLIC
  380.     "short-koi",          FC_KOI7,    0, /* Short KOI Cyrillic */
  381. #endif /* CYRILLIC */
  382.     "spanish",            FC_SPASCII, 0, /* Spanish NRC */
  383.     "swedish",            FC_SWASCII, 0, /* Swedish NRC */
  384.     "swiss",              FC_CHASCII, 0, /* Swiss NRC */
  385.     "transparent",        FC_TRANSP,  0  /* Transparent */
  386. };
  387. int ntermc = (sizeof(ttcstab) / sizeof(struct keytab)); /* size of table */
  388.  
  389. /*
  390.  Languages:
  391.  
  392.  This table allows C-Kermit to have a SET LANGUAGE command to apply special
  393.  language-specific rules when translating from a character set that contains
  394.  national characters into plain ASCII, like German umlaut-a becomes ae.
  395.  
  396.  Originally, I thought it would be a good idea to let SET LANGUAGE also select
  397.  an appropriate FILE CHARACTER-SET and TRANSFER CHARACTER-SET automatically,
  398.  and these are included in the langinfo structure.  Later I realized that this
  399.  was a bad idea.  Users are confused by unexpected side effects.  If this
  400.  functionality is desired, it's better to define a macro to do it.
  401. */
  402.  
  403. struct langinfo langs[] = {
  404. /*  Language code   File Charset Xfer Charset Name */
  405.     L_USASCII,      FC_USASCII,  TC_USASCII,  "ASCII (American English)",
  406.     L_DANISH,       FC_NOASCII,  TC_1LATIN,   "Danish",
  407.     L_DUTCH,        FC_DUASCII,  TC_1LATIN,   "Dutch",
  408.     L_FINNISH,      FC_FIASCII,  TC_1LATIN,   "Finnish",
  409.     L_FRENCH,       FC_FRASCII,  TC_1LATIN,   "French",
  410.     L_GERMAN,       FC_GEASCII,  TC_1LATIN,   "German",
  411. #ifdef HEBREW
  412.     L_HEBREW,       FC_HEBREW,   TC_HEBREW,   "Hebrew",
  413. #endif /* HEBREW */
  414.     L_HUNGARIAN,    FC_HUASCII,  TC_2LATIN,   "Hungarian",
  415.     L_ICELANDIC,    FC_USASCII,  TC_1LATIN,   "Icelandic",
  416.     L_ITALIAN,      FC_ITASCII,  TC_1LATIN,   "Italian",
  417. #ifdef KANJI
  418.     L_JAPANESE,     FC_JEUC,     TC_JEUC,     "Japanese",
  419. #endif /* KANJI */
  420.     L_NORWEGIAN,    FC_NOASCII,  TC_1LATIN,   "Norwegian",
  421.     L_PORTUGUESE,   FC_POASCII,  TC_1LATIN,   "Portuguese",
  422. #ifdef CYRILLIC
  423.     L_RUSSIAN,      FC_CP866,    TC_CYRILL,   "Russian",
  424. #endif /* CYRILLIC */
  425.     L_SPANISH,      FC_SPASCII,  TC_1LATIN,   "Spanish",
  426.     L_SWEDISH,      FC_SWASCII,  TC_1LATIN,   "Swedish",
  427.     L_SWISS,        FC_CHASCII,  TC_1LATIN,   "Swiss"
  428. };
  429. int nlangs = (sizeof(langs) / sizeof(struct langinfo));
  430.  
  431. /*
  432.   Keyword table for the SET LANGUAGE command.
  433.   Only a few of these (German, Scandinavian, etc) actually do anything.
  434.   The language is used to invoke special translation rules when converting
  435.   from an 8-bit character set to ASCII; for example, German u-diaeresis
  436.   becomes "ue", Dutch y-diaeresis becomes "ij".  Languages without associated
  437.   rules are invisible (CM_INV).
  438. */
  439. struct keytab lngtab[] = {
  440.     "ascii",            L_USASCII,    CM_INV,
  441.     "danish",           L_DANISH,     0,
  442.     "dutch",            L_DUTCH,      0,
  443.     "english",          L_USASCII,    CM_INV,
  444.     "finnish",          L_FINNISH,    0,
  445.     "french",           L_FRENCH,     0,
  446.     "german",           L_GERMAN,     0,
  447. #ifdef HEBREW
  448.     "hebrew",           L_HEBREW,     CM_INV,
  449. #endif /* HEBREW */    
  450.     "hungarian",        L_HUNGARIAN,  CM_INV,
  451.     "icelandic",        L_ICELANDIC,  0,
  452.     "italian",          L_ITALIAN,    CM_INV,
  453. #ifdef KANJI
  454.     "japanese",         L_JAPANESE,   CM_INV,
  455. #endif /* KANJI */
  456.     "norwegian",        L_NORWEGIAN,  0,
  457.     "none",             L_USASCII,    0,
  458.     "portuguese",       L_PORTUGUESE, CM_INV,
  459. #ifdef CYRILLIC
  460.     "russian",          L_RUSSIAN,    0,
  461. #endif /* CYRILLIC */
  462.     "spanish",          L_SPANISH,    CM_INV,
  463.     "swedish",          L_SWEDISH,    0
  464. #ifdef CYRILLIC
  465. ,   "ukrainian",        L_RUSSIAN,    0
  466. #endif /* CYRILLIC */
  467. };
  468. int nlng = (sizeof(lngtab) / sizeof(struct keytab)); /* how many languages */
  469.  
  470.  
  471. /* Translation tables ... */
  472.  
  473. /*
  474.   For each pair of (transfer,file) character sets, we need two translation
  475.   functions, one for sending, one for receiving.
  476. */
  477.  
  478. /*
  479.   Here is the first table, Latin-1 to ASCII, fully annotated...
  480.   This one is absolutely NOT invertible, since we're going from an 8-bit
  481.   set to a 7-bit set.  Accented letters are mapped to unaccented
  482.   equivalents, C1 control characters are all translated to "?", etc.
  483. */
  484. CHAR
  485. yl1as[] = {  /* ISO 8859-1 Latin Alphabet 1 to US ASCII */
  486.       /*  Source character    Description               => Translation */
  487.       /*  Dec row/col Set                                           */
  488.   0,  /*  000  00/00  C0 NUL  Ctrl-@                    =>  (self)  */
  489.   1,  /*  001  00/01  C0 SOH  Ctrl-A                    =>  (self)  */
  490.   2,  /*  002  00/02  C0 STX  Ctrl-B                    =>  (self)  */
  491.   3,  /*  003  00/03  C0 ETX  Ctrl-C                    =>  (self)  */
  492.   4,  /*  004  00/04  C0 EOT  Ctrl-D                    =>  (self)  */
  493.   5,  /*  005  00/05  C0 ENQ  Ctrl-E                    =>  (self)  */
  494.   6,  /*  006  00/06  C0 ACK  Ctrl-F                    =>  (self)  */
  495.   7,  /*  007  00/07  C0 BEL  Ctrl-G                    =>  (self)  */
  496.   8,  /*  008  00/08  C0 BS   Ctrl-H                    =>  (self)  */
  497.   9,  /*  009  00/09  C0 HT   Ctrl-I                    =>  (self)  */
  498.  10,  /*  010  00/10  C0 LF   Ctrl-J                    =>  (self)  */
  499.  11,  /*  011  00/11  C0 VT   Ctrl-K                    =>  (self)  */
  500.  12,  /*  012  00/12  C0 FF   Ctrl-L                    =>  (self)  */
  501.  13,  /*  013  00/13  C0 CR   Ctrl-M                    =>  (self)  */
  502.  14,  /*  014  00/14  C0 SO   Ctrl-N                    =>  (self)  */
  503.  15,  /*  015  00/15  C0 SI   Ctrl-O                    =>  (self)  */
  504.  16,  /*  016  01/00  C0 DLE  Ctrl-P                    =>  (self)  */
  505.  17,  /*  017  01/01  C0 DC1  Ctrl-Q                    =>  (self)  */
  506.  18,  /*  018  01/02  C0 DC2  Ctrl-R                    =>  (self)  */
  507.  19,  /*  019  01/03  C0 DC3  Ctrl-S                    =>  (self)  */
  508.  20,  /*  020  01/04  C0 DC4  Ctrl-T                    =>  (self)  */
  509.  21,  /*  021  01/05  C0 NAK  Ctrl-U                    =>  (self)  */
  510.  22,  /*  022  01/06  C0 SYN  Ctrl-V                    =>  (self)  */
  511.  23,  /*  023  01/07  C0 ETB  Ctrl-W                    =>  (self)  */
  512.  24,  /*  024  01/08  C0 CAN  Ctrl-X                    =>  (self)  */
  513.  25,  /*  025  01/09  C0 EM   Ctrl-Y                    =>  (self)  */
  514.  26,  /*  026  01/10  C0 SUB  Ctrl-Z                    =>  (self)  */
  515.  27,  /*  027  01/11  C0 ESC  Ctrl-[                    =>  (self)  */
  516.  28,  /*  028  01/12  C0 FS   Ctrl-\                    =>  (self)  */
  517.  29,  /*  029  01/13  C0 GS   Ctrl-]                    =>  (self)  */
  518.  30,  /*  030  01/14  C0 RS   Ctrl-^                    =>  (self)  */
  519.  31,  /*  031  01/15  C0 US   Ctrl-_                    =>  (self)  */
  520.  32,  /*  032  02/00     SP   Space                     =>  (self)  */
  521.  33,  /*  033  02/01  G0 !    Exclamation mark          =>  (self)  */
  522.  34,  /*  034  02/02  G0 "    Doublequote               =>  (self)  */
  523.  35,  /*  035  02/03  G0 #    Number sign               =>  (self)  */
  524.  36,  /*  036  02/04  G0 $    Dollar sign               =>  (self)  */
  525.  37,  /*  037  02/05  G0 %    Percent sign              =>  (self)  */
  526.  38,  /*  038  02/06  G0 &    Ampersand                 =>  (self)  */
  527.  39,  /*  039  02/07  G0 '    Apostrophe                =>  (self)  */
  528.  40,  /*  040  02/08  G0 (    Left parenthesis          =>  (self)  */
  529.  41,  /*  041  02/09  G0 )    Right parenthesis         =>  (self)  */
  530.  42,  /*  042  02/10  G0 *    Asterisk                  =>  (self)  */
  531.  43,  /*  043  02/11  G0 +    Plus sign                 =>  (self)  */
  532.  44,  /*  044  02/12  G0 ,    Comma                     =>  (self)  */
  533.  45,  /*  045  02/13  G0 -    Hyphen, minus sign        =>  (self)  */
  534.  46,  /*  046  02/14  G0 .    Period, full stop         =>  (self)  */
  535.  47,  /*  047  02/15  G0 /    Slash, solidus            =>  (self)  */
  536.  48,  /*  048  03/00  G0 0    Digit 0                   =>  (self)  */
  537.  49,  /*  049  03/01  G0 1    Digit 1                   =>  (self)  */
  538.  50,  /*  050  03/02  G0 2    Digit 2                   =>  (self)  */
  539.  51,  /*  051  03/03  G0 3    Digit 3                   =>  (self)  */
  540.  52,  /*  052  03/04  G0 4    Digit 4                   =>  (self)  */
  541.  53,  /*  053  03/05  G0 5    Digit 5                   =>  (self)  */
  542.  54,  /*  054  03/06  G0 6    Digit 6                   =>  (self)  */
  543.  55,  /*  055  03/07  G0 7    Digit 7                   =>  (self)  */
  544.  56,  /*  056  03/08  G0 8    Digit 8                   =>  (self)  */
  545.  57,  /*  057  03/09  G0 9    Digit 9                   =>  (self)  */
  546.  58,  /*  058  03/10  G0 :    Colon                     =>  (self)  */
  547.  59,  /*  059  03/11  G0 ;    Semicolon                 =>  (self)  */
  548.  60,  /*  060  03/12  G0 <    Less-than sign            =>  (self)  */
  549.  61,  /*  061  03/13  G0 =    Equals sign               =>  (self)  */
  550.  62,  /*  062  03/14  G0 >    Greater-than sign         =>  (self)  */
  551.  63,  /*  063  03/15  G0 ?    Question mark             =>  (self)  */
  552.  64,  /*  064  04/00  G0 @    Commercial at sign        =>  (self)  */
  553.  65,  /*  065  04/01  G0 A    Letter A                  =>  (self)  */
  554.  66,  /*  066  04/02  G0 B    Letter B                  =>  (self)  */
  555.  67,  /*  067  04/03  G0 C    Letter C                  =>  (self)  */
  556.  68,  /*  068  04/04  G0 D    Letter D                  =>  (self)  */
  557.  69,  /*  069  04/05  G0 E    Letter E                  =>  (self)  */
  558.  70,  /*  070  04/06  G0 F    Letter F                  =>  (self)  */
  559.  71,  /*  071  04/07  G0 G    Letter G                  =>  (self)  */
  560.  72,  /*  072  04/08  G0 H    Letter H                  =>  (self)  */
  561.  73,  /*  073  04/09  G0 I    Letter I                  =>  (self)  */
  562.  74,  /*  074  04/10  G0 J    Letter J                  =>  (self)  */
  563.  75,  /*  075  04/11  G0 K    Letter K                  =>  (self)  */
  564.  76,  /*  076  04/12  G0 L    Letter L                  =>  (self)  */
  565.  77,  /*  077  04/13  G0 M    Letter M                  =>  (self)  */
  566.  78,  /*  078  04/14  G0 N    Letter N                  =>  (self)  */
  567.  79,  /*  079  04/15  G0 O    Letter O                  =>  (self)  */
  568.  80,  /*  080  05/00  G0 P    Letter P                  =>  (self)  */
  569.  81,  /*  081  05/01  G0 Q    Letter Q                  =>  (self)  */
  570.  82,  /*  082  05/02  G0 R    Letter R                  =>  (self)  */
  571.  83,  /*  083  05/03  G0 S    Letter S                  =>  (self)  */
  572.  84,  /*  084  05/04  G0 T    Letter T                  =>  (self)  */
  573.  85,  /*  085  05/05  G0 U    Letter U                  =>  (self)  */
  574.  86,  /*  086  05/06  G0 V    Letter V                  =>  (self)  */
  575.  87,  /*  087  05/07  G0 W    Letter W                  =>  (self)  */
  576.  88,  /*  088  05/08  G0 X    Letter X                  =>  (self)  */
  577.  89,  /*  089  05/09  G0 Y    Letter Y                  =>  (self)  */
  578.  90,  /*  090  05/10  G0 Z    Letter Z                  =>  (self)  */
  579.  91,  /*  091  05/11  G0 [    Left square bracket       =>  (self)  */
  580.  92,  /*  092  05/12  G0 \    Reverse slash             =>  (self)  */
  581.  93,  /*  093  05/13  G0 ]    Right square bracket      =>  (self)  */
  582.  94,  /*  094  05/14  G0 ^    Circumflex accent         =>  (self)  */
  583.  95,  /*  095  05/15  G0 _    Underline, low line       =>  (self)  */
  584.  96,  /*  096  06/00  G0 `    Grave accent              =>  (self)  */
  585.  97,  /*  097  06/01  G0 a    Letter a                  =>  (self)  */
  586.  98,  /*  098  06/02  G0 b    Letter b                  =>  (self)  */
  587.  99,  /*  099  06/03  G0 c    Letter c                  =>  (self)  */
  588. 100,  /*  100  06/04  G0 d    Letter d                  =>  (self)  */
  589. 101,  /*  101  06/05  G0 e    Letter e                  =>  (self)  */
  590. 102,  /*  102  06/06  G0 f    Letter f                  =>  (self)  */
  591. 103,  /*  103  06/07  G0 g    Letter g                  =>  (self)  */
  592. 104,  /*  104  06/08  G0 h    Letter h                  =>  (self)  */
  593. 105,  /*  105  06/09  G0 i    Letter i                  =>  (self)  */
  594. 106,  /*  106  06/10  G0 j    Letter j                  =>  (self)  */
  595. 107,  /*  107  06/11  G0 k    Letter k                  =>  (self)  */
  596. 108,  /*  108  06/12  G0 l    Letter l                  =>  (self)  */
  597. 109,  /*  109  06/13  G0 m    Letter m                  =>  (self)  */
  598. 110,  /*  110  06/14  G0 n    Letter n                  =>  (self)  */
  599. 111,  /*  111  06/15  G0 o    Letter o                  =>  (self)  */
  600. 112,  /*  112  07/00  G0 p    Letter p                  =>  (self)  */
  601. 113,  /*  113  07/01  G0 q    Letter q                  =>  (self)  */
  602. 114,  /*  114  07/02  G0 r    Letter r                  =>  (self)  */
  603. 115,  /*  115  07/03  G0 s    Letter s                  =>  (self)  */
  604. 116,  /*  116  07/04  G0 t    Letter t                  =>  (self)  */
  605. 117,  /*  117  07/05  G0 u    Letter u                  =>  (self)  */
  606. 118,  /*  118  07/06  G0 v    Letter v                  =>  (self)  */
  607. 119,  /*  119  07/07  G0 w    Letter w                  =>  (self)  */
  608. 120,  /*  120  07/08  G0 x    Letter x                  =>  (self)  */
  609. 121,  /*  121  07/09  G0 y    Letter y                  =>  (self)  */
  610. 122,  /*  122  07/10  G0 z    Letter z                  =>  (self)  */
  611. 123,  /*  123  07/11  G0 {    Left curly bracket        =>  (self)  */
  612. 124,  /*  124  07/12  G0 |    Vertical bar              =>  (self)  */
  613. 125,  /*  125  07/13  G0 }    Right curly bracket       =>  (self)  */
  614. 126,  /*  126  07/14  G0 ~    Tilde                     =>  (self)  */
  615. 127,  /*  127  07/15     DEL  Delete, Rubout            =>  (self)  */
  616. UNK,  /*  128  08/00  C1                                =>  UNK     */
  617. UNK,  /*  129  08/01  C1                                =>  UNK     */
  618. UNK,  /*  130  08/02  C1                                =>  UNK     */
  619. UNK,  /*  131  08/03  C1                                =>  UNK     */
  620. UNK,  /*  132  08/04  C1 IND                            =>  UNK     */
  621. UNK,  /*  133  08/05  C1 NEL                            =>  UNK     */
  622. UNK,  /*  134  08/06  C1 SSA                            =>  UNK     */
  623. UNK,  /*  135  08/07  C1 ESA                            =>  UNK     */
  624. UNK,  /*  136  08/08  C1 HTS                            =>  UNK     */
  625. UNK,  /*  137  08/09  C1                                =>  UNK     */
  626. UNK,  /*  138  08/10  C1                                =>  UNK     */
  627. UNK,  /*  139  08/11  C1                                =>  UNK     */
  628. UNK,  /*  140  08/12  C1                                =>  UNK     */
  629. UNK,  /*  141  08/13  C1 RI                             =>  UNK     */
  630. UNK,  /*  142  08/14  C1 SS2                            =>  UNK     */
  631. UNK,  /*  143  08/15  C1 SS3                            =>  UNK     */
  632. UNK,  /*  144  09/00  C1 DCS                            =>  UNK     */
  633. UNK,  /*  145  09/01  C1                                =>  UNK     */
  634. UNK,  /*  146  09/02  C1                                =>  UNK     */
  635. UNK,  /*  147  09/03  C1 STS                            =>  UNK     */
  636. UNK,  /*  148  09/04  C1                                =>  UNK     */
  637. UNK,  /*  149  09/05  C1                                =>  UNK     */
  638. UNK,  /*  150  09/06  C1 SPA                            =>  UNK     */
  639. UNK,  /*  151  09/07  C1 EPA                            =>  UNK     */
  640. UNK,  /*  152  09/08  C1                                =>  UNK     */
  641. UNK,  /*  153  09/09  C1                                =>  UNK     */
  642. UNK,  /*  154  09/10  C1                                =>  UNK     */
  643. UNK,  /*  155  09/11  C1 CSI                            =>  UNK     */
  644. UNK,  /*  156  09/12  C1 ST                             =>  UNK     */
  645. UNK,  /*  157  09/13  C1 OSC                            =>  UNK     */
  646. UNK,  /*  158  09/14  C1 PM                             =>  UNK     */
  647. UNK,  /*  159  09/15  C1 APC                            =>  UNK     */
  648.  32,  /*  160  10/00  G1      No-break space            =>  SP      */
  649.  33,  /*  161  10/01  G1      Inverted exclamation      =>  !       */
  650.  99,  /*  162  10/02  G1      Cent sign                 =>  c       */
  651.  35,  /*  163  10/03  G1      Pound sign                =>  #       */
  652.  36,  /*  164  10/04  G1      Currency sign             =>  $       */
  653.  89,  /*  165  10/05  G1      Yen sign                  =>  Y       */
  654. 124,  /*  166  10/06  G1      Broken bar                =>  |       */
  655.  80,  /*  167  10/07  G1      Paragraph sign            =>  P       */
  656.  34,  /*  168  10/08  G1      Diaeresis                 =>  "       */
  657.  67,  /*  169  10/09  G1      Copyright sign            =>  C       */
  658.  97,  /*  170  10/10  G1      Feminine ordinal          =>  a       */
  659.  34,  /*  171  10/11  G1      Left angle quotation      =>  "       */
  660. 126,  /*  172  10/12  G1      Not sign                  =>  ~       */
  661.  45,  /*  173  10/13  G1      Soft hyphen               =>  -       */
  662.  82,  /*  174  10/14  G1      Registered trade mark     =>  R       */
  663.  95,  /*  175  10/15  G1      Macron                    =>  _       */
  664. 111,  /*  176  11/00  G1      Degree sign, ring above   =>  o       */
  665. UNK,  /*  177  11/01  G1      Plus-minus sign           =>  UNK     */
  666.  50,  /*  178  11/02  G1      Superscript two           =>  2       */
  667.  51,  /*  179  11/03  G1      Superscript three         =>  3       */
  668.  39,  /*  180  11/04  G1      Acute accent              =>  '       */
  669. 117,  /*  181  11/05  G1      Micro sign                =>  u       */
  670.  45,  /*  182  11/06  G1      Pilcrow sign              =>  -       */
  671.  45,  /*  183  11/07  G1      Middle dot                =>  -       */
  672.  44,  /*  184  11/08  G1      Cedilla                   =>  ,       */
  673.  49,  /*  185  11/09  G1      Superscript one           =>  1       */
  674. 111,  /*  186  11/10  G1      Masculine ordinal         =>  o       */
  675.  34,  /*  187  11/11  G1      Right angle quotation     =>  "       */
  676. UNK,  /*  188  11/12  G1      One quarter               =>  UNK     */
  677. UNK,  /*  189  11/13  G1      One half                  =>  UNK     */
  678. UNK,  /*  190  11/14  G1      Three quarters            =>  UNK     */
  679.  63,  /*  191  11/15  G1      Inverted question mark    =>  ?       */
  680.  65,  /*  192  12/00  G1      A grave                   =>  A       */
  681.  65,  /*  193  12/01  G1      A acute                   =>  A       */
  682.  65,  /*  194  12/02  G1      A circumflex              =>  A       */
  683.  65,  /*  195  12/03  G1      A tilde                   =>  A       */
  684.  65,  /*  196  12/04  G1      A diaeresis               =>  A       */
  685.  65,  /*  197  12/05  G1      A ring above              =>  A       */
  686.  65,  /*  198  12/06  G1      A with E                  =>  A       */
  687.  67,  /*  199  12/07  G1      C Cedilla                 =>  C       */
  688.  69,  /*  200  12/08  G1      E grave                   =>  E       */
  689.  69,  /*  201  12/09  G1      E acute                   =>  E       */
  690.  69,  /*  202  12/10  G1      E circumflex              =>  E       */
  691.  69,  /*  203  12/11  G1      E diaeresis               =>  E       */
  692.  73,  /*  204  12/12  G1      I grave                   =>  I       */
  693.  73,  /*  205  12/13  G1      I acute                   =>  I       */
  694.  73,  /*  206  12/14  G1      I circumflex              =>  I       */
  695.  73,  /*  207  12/15  G1      I diaeresis               =>  I       */
  696.  68,  /*  208  13/00  G1      Icelandic Eth             =>  D       */
  697.  78,  /*  209  13/01  G1      N tilde                   =>  N       */
  698.  79,  /*  210  13/02  G1      O grave                   =>  O       */
  699.  79,  /*  211  13/03  G1      O acute                   =>  O       */
  700.  79,  /*  212  13/04  G1      O circumflex              =>  O       */
  701.  79,  /*  213  13/05  G1      O tilde                   =>  O       */
  702.  79,  /*  214  13/06  G1      O diaeresis               =>  O       */
  703. 120,  /*  215  13/07  G1      Multiplication sign       =>  x       */
  704.  79,  /*  216  13/08  G1      O oblique stroke          =>  O       */
  705.  85,  /*  217  13/09  G1      U grave                   =>  U       */
  706.  85,  /*  218  13/10  G1      U acute                   =>  U       */
  707.  85,  /*  219  13/11  G1      U circumflex              =>  U       */
  708.  85,  /*  220  13/12  G1      U diaeresis               =>  U       */
  709.  89,  /*  221  13/13  G1      Y acute                   =>  Y       */
  710.  84,  /*  222  13/14  G1      Icelandic Thorn           =>  T       */
  711. 115,  /*  223  13/15  G1      German sharp s            =>  s       */
  712.  97,  /*  224  14/00  G1      a grave                   =>  a       */
  713.  97,  /*  225  14/01  G1      a acute                   =>  a       */
  714.  97,  /*  226  14/02  G1      a circumflex              =>  a       */
  715.  97,  /*  227  14/03  G1      a tilde                   =>  a       */
  716.  97,  /*  228  14/04  G1      a diaeresis               =>  a       */
  717.  97,  /*  229  14/05  G1      a ring above              =>  a       */
  718.  97,  /*  230  14/06  G1      a with e                  =>  a       */
  719.  99,  /*  231  14/07  G1      c cedilla                 =>  c       */
  720. 101,  /*  232  14/08  G1      e grave                   =>  e       */
  721. 101,  /*  233  14/09  G1      e acute                   =>  e       */
  722. 101,  /*  234  14/10  G1      e circumflex              =>  e       */
  723. 101,  /*  235  14/11  G1      e diaeresis               =>  e       */
  724. 105,  /*  236  14/12  G1      i grave                   =>  i       */
  725. 105,  /*  237  14/13  G1      i acute                   =>  i       */
  726. 105,  /*  238  14/14  G1      i circumflex              =>  i       */
  727. 105,  /*  239  14/15  G1      i diaeresis               =>  i       */
  728. 100,  /*  240  15/00  G1      Icelandic eth             =>  d       */
  729. 110,  /*  241  15/01  G1      n tilde                   =>  n       */
  730. 111,  /*  242  15/02  G1      o grave                   =>  o       */
  731. 111,  /*  243  15/03  G1      o acute                   =>  o       */
  732. 111,  /*  244  15/04  G1      o circumflex              =>  o       */
  733. 111,  /*  245  15/05  G1      o tilde                   =>  o       */
  734. 111,  /*  246  15/06  G1      o diaeresis               =>  o       */
  735.  47,  /*  247  15/07  G1      Division sign             =>  /       */
  736. 111,  /*  248  15/08  G1      o oblique stroke          =>  o       */
  737. 117,  /*  249  15/09  G1      u grave                   =>  u       */
  738. 117,  /*  250  15/10  G1      u acute                   =>  u       */
  739. 117,  /*  251  15/11  G1      u circumflex              =>  u       */
  740. 117,  /*  252  15/12  G1      u diaeresis               =>  u       */
  741. 121,  /*  253  15/13  G1      y acute                   =>  y       */
  742. 116,  /*  254  15/14  G1      Icelandic thorn           =>  t       */
  743. 121   /*  255  15/15  G1      y diaeresis               =>  y       */
  744. };
  745.  
  746.  
  747. /* Translation tables for ISO Latin Alphabet 1 to local file character sets */
  748.  
  749. /*
  750.   Most of the remaining tables are not annotated like the one above, because
  751.   the size of the resulting source file would be ridiculous.  Each row in the
  752.   following tables corresponds to a column of ISO 8859-1.
  753. */
  754.  
  755. CHAR
  756. yl185[] = {  /* ISO 8859-1 Latin Alphabet 1 (Latin-1) to IBM Code Page 850 */
  757. /*
  758.   This is based on IBM's official invertible translation.  Reference: IBM
  759.   Character Data Representation Architecture (CDRA), Level 1, Registry,
  760.   SC09-1291-00 (1990), p.152.  (Note: Latin-1 is IBM Code Page 00819.)  Note:
  761.   IBM's bizarre rearrangement of C0 controls and DEL has been undone in this
  762.   table.
  763. */
  764.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  765.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  766.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  767.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  768.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  769.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  770.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  771. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  772. 186, 205, 201, 187, 200, 188, 204, 185, 203, 202, 206, 223, 220, 219, 254, 242,
  773. 179, 196, 218, 191, 192, 217, 195, 180, 194, 193, 197, 176, 177, 178, 213, 159,
  774. 255, 173, 189, 156, 207, 190, 221, 245, 249, 184, 166, 174, 170, 240, 169, 238,
  775. 248, 241, 253, 252, 239, 230, 244, 250, 247, 251, 167, 175, 172, 171, 243, 168,
  776. 183, 181, 182, 199, 142, 143, 146, 128, 212, 144, 210, 211, 222, 214, 215, 216,
  777. 209, 165, 227, 224, 226, 229, 153, 158, 157, 235, 233, 234, 154, 237, 232, 225,
  778. 133, 160, 131, 198, 132, 134, 145, 135, 138, 130, 136, 137, 141, 161, 140, 139,
  779. 208, 164, 149, 162, 147, 228, 148, 246, 155, 151, 163, 150, 129, 236, 231, 152
  780. };
  781.  
  782. CHAR
  783. y85l1[] = {  /* IBM Code Page 850 to Latin-1 */
  784. /*
  785.   This is from IBM CDRA page 153.  It is the inverse of yl185[].
  786.   As of edit 183, this table is no longer pure CDRA.  The translations 
  787.   involving C0 controls and DEL have been removed.
  788. */
  789.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  790.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  791.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  792.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  793.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  794.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  795.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  796. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  797. 199, 252, 233, 226, 228, 224, 229, 231, 234, 235, 232, 239, 238, 236, 196, 197,
  798. 201, 230, 198, 244, 246, 242, 251, 249, 255, 214, 220, 248, 163, 216, 215, 159,
  799. 225, 237, 243, 250, 241, 209, 170, 186, 191, 174, 172, 189, 188, 161, 171, 187,
  800. 155, 156, 157, 144, 151, 193, 194, 192, 169, 135, 128, 131, 133, 162, 165, 147,
  801. 148, 153, 152, 150, 145, 154, 227, 195, 132, 130, 137, 136, 134, 129, 138, 164,
  802. 240, 208, 202, 203, 200, 158, 205, 206, 207, 149, 146, 141, 140, 166, 204, 139,
  803. 211, 223, 212, 210, 245, 213, 181, 254, 222, 218, 219, 217, 253, 221, 175, 180,
  804. 173, 177, 143, 190, 182, 167, 247, 184, 176, 168, 183, 185, 179, 178, 142, 160
  805. };
  806.  
  807. #ifdef COMMENT
  808. CHAR
  809. yl1r8[] = {  /* Latin-1 to Hewlett Packard Roman8 */
  810. /* This is HP's official translation, straight from iconv */
  811. /* It is NOT invertible. */
  812.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  813.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  814.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  815.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  816.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  817.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  818.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  819. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  820. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  821. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  822. 160, 184, 191, 187, 186, 188, 124, 189, 171,  99, 249, 251, 126,  45,  82, 176,
  823. 179, 254,  50,  51, 168, 243, 244, 242,  44,  49, 250, 253, 247, 248, 245, 185,
  824. 161, 224, 162, 225, 216, 208, 211, 180, 163, 220, 164, 165, 230, 229, 166, 167,
  825. 227, 182, 232, 231, 223, 233, 218, 120, 210, 173, 237, 174, 219, 177, 240, 222,
  826. 200, 196, 192, 226, 204, 212, 215, 181, 201, 197, 193, 205, 217, 213, 209, 221,
  827. 228, 183, 202, 198, 194, 234, 206,  47, 214, 203, 199, 195, 207, 178, 241, 239
  828. };
  829. CHAR
  830. yr8l1[] = {  /* Hewlett Packard Roman8 to Latin-1 */
  831. /* This is HP's official translation, straight from iconv */
  832. /* It is NOT invertible. */
  833.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  834.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  835.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  836.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  837.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  838.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  839.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  840. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  841. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  842. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  843. 160, 192, 194, 200, 202, 203, 206, 207, 180,  96,  94, 168, 126, 217, 219, 163,
  844. 175, 221, 253, 176, 199, 231, 209, 241, 161, 191, 164, 163, 165, 167, 102, 162,
  845. 226, 234, 244, 251, 225, 233, 243, 250, 224, 232, 242, 249, 228, 235, 246, 252,
  846. 197, 238, 216, 198, 229, 237, 248, 230, 196, 236, 214, 220, 201, 239, 223, 212,
  847. 193, 195, 227, 208, 240, 205, 204, 211, 210, 213, 245,  83, 115, 218,  89, 255,
  848. 222, 254, 183, 181, 182, 190,  45, 188, 189, 170, 186, 171,  42, 187, 177, 160
  849. };
  850. #else /* !COMMENT */
  851. /* This is an invertible mapping, approved by HP in January 1994. */
  852. CHAR
  853. yl1r8[] = {  /* ISO Latin-1 to HP Roman8, Invertible */
  854.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  855.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  856.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  857.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  858.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  859.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  860.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  861. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  862. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  863. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  864. 160, 184, 191, 187, 186, 188, 169, 189, 171, 170, 249, 251, 172, 175, 190, 176,
  865. 179, 254, 235, 236, 168, 243, 244, 242, 238, 246, 250, 253, 247, 248, 245, 185,
  866. 161, 224, 162, 225, 216, 208, 211, 180, 163, 220, 164, 165, 230, 229, 166, 167,
  867. 227, 182, 232, 231, 223, 233, 218, 252, 210, 173, 237, 174, 219, 177, 240, 222,
  868. 200, 196, 192, 226, 204, 212, 215, 181, 201, 197, 193, 205, 217, 213, 209, 221,
  869. 228, 183, 202, 198, 194, 234, 206, 255, 214, 203, 199, 195, 207, 178, 241, 239
  870. };
  871.  
  872. CHAR
  873. yr8l1[] = { /* HP Roman8 to ISO Latin-1, Invertible */
  874.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  875.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  876.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  877.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  878.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  879.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  880.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  881. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  882. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  883. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  884. 160, 192, 194, 200, 202, 203, 206, 207, 180, 166, 169, 168, 172, 217, 219, 173,
  885. 175, 221, 253, 176, 199, 231, 209, 241, 161, 191, 164, 163, 165, 167, 174, 162,
  886. 226, 234, 244, 251, 225, 233, 243, 250, 224, 232, 242, 249, 228, 235, 246, 252,
  887. 197, 238, 216, 198, 229, 237, 248, 230, 196, 236, 214, 220, 201, 239, 223, 212,
  888. 193, 195, 227, 208, 240, 205, 204, 211, 210, 213, 245, 178, 179, 218, 184, 255,
  889. 222, 254, 183, 181, 182, 190, 185, 188, 189, 170, 186, 171, 215, 187, 177, 247
  890. };
  891. #endif /* COMMENT */
  892.  
  893. CHAR
  894. yl143[] = {  /* Latin-1 to IBM Code Page 437 */
  895. /*
  896.   Although the IBM CDRA does not include an official translation between CP437
  897.   and ISO Latin Alphabet 1, it does include an official, invertible
  898.   translation between CP437 and CP850 (page 196), and another from CP850 to
  899.   Latin-1 (CP819) (page 153).  This translation was obtained with a two-step
  900.   process based on those tables.
  901.   As of edit 183, the translation is modified to leave C0 controls alone.
  902. */
  903.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  904.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  905.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  906.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  907.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  908.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  909.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  910. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  911. 186, 205, 201, 187, 200, 188, 204, 185, 203, 202, 206, 223, 220, 219, 254, 242,
  912. 179, 196, 218, 191, 192, 217, 195, 180, 194, 193, 197, 176, 177, 178, 213, 159,
  913. 255, 173, 155, 156, 207, 157, 221, 245, 249, 184, 166, 174, 170, 240, 169, 238,
  914. 248, 241, 253, 252, 239, 230, 244, 250, 247, 251, 167, 175, 172, 171, 243, 168,
  915. 183, 181, 182, 199, 142, 143, 146, 128, 212, 144, 210, 211, 222, 214, 215, 216,
  916. 209, 165, 227, 224, 226, 229, 153, 158, 190, 235, 233, 234, 154, 237, 232, 225,
  917. 133, 160, 131, 198, 132, 134, 145, 135, 138, 130, 136, 137, 141, 161, 140, 139,
  918. 208, 164, 149, 162, 147, 228, 148, 246, 189, 151, 163, 150, 129, 236, 231, 152
  919. };
  920.  
  921. CHAR
  922. y43l1[] = {  /* IBM Code Page 437 to Latin-1 */
  923. /*
  924.   This table is the inverse of yl143[].
  925. */
  926.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  927.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  928.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  929.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  930.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  931.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  932.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  933. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  934. 199, 252, 233, 226, 228, 224, 229, 231, 234, 235, 232, 239, 238, 236, 196, 197,
  935. 201, 230, 198, 244, 246, 242, 251, 249, 255, 214, 220, 162, 163, 165, 215, 159,
  936. 225, 237, 243, 250, 241, 209, 170, 186, 191, 174, 172, 189, 188, 161, 171, 187,
  937. 155, 156, 157, 144, 151, 193, 194, 192, 169, 135, 128, 131, 133, 248, 216, 147,
  938. 148, 153, 152, 150, 145, 154, 227, 195, 132, 130, 137, 136, 134, 129, 138, 164,
  939. 240, 208, 202, 203, 200, 158, 205, 206, 207, 149, 146, 141, 140, 166, 204, 139,
  940. 211, 223, 212, 210, 245, 213, 181, 254, 222, 218, 219, 217, 253, 221, 175, 180,
  941. 173, 177, 143, 190, 182, 167, 247, 184, 176, 168, 183, 185, 179, 178, 142, 160
  942. };
  943.  
  944. CHAR
  945. yl1aq[] = {  /* Latin-1 to Extended Mac Latin (based on Apple QuickDraw) */
  946.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  947.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  948.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  949.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  950.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  951.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  952.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  953. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  954. 182, 183, 184, 185, 189, 196, 197, 198, 206, 207, 210, 211, 217, 218, 195, 212,
  955. 209, 215, 213, 226, 227, 228, 240, 245, 246, 247, 249, 250, 251, 253, 254, 255,
  956. 202, 193, 162, 163, 219, 180, 201, 164, 172, 169, 187, 199, 194, 208, 168, 248,
  957. 161, 177, 170, 173, 171, 181, 166, 225, 252, 176, 188, 200, 178, 179, 186, 192,
  958. 203, 231, 229, 204, 128, 129, 174, 130, 233, 131, 230, 232, 237, 234, 235, 236,
  959. 220, 132, 241, 238, 239, 205, 133, 165, 175, 244, 242, 243, 134, 160, 222, 167,
  960. 136, 135, 137, 139, 138, 140, 190, 141, 143, 142, 144, 145, 147, 146, 148, 149,
  961. 221, 150, 152, 151, 153, 155, 154, 214, 191, 157, 156, 158, 159, 224, 223, 216
  962. };
  963.  
  964. CHAR
  965. yl1du[] = {  /* Latin-1 to Dutch ISO 646 */
  966.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  967.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  968.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  969.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  970. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  971.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  972.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  973. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK,  39, 127,
  974. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  975. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  976.  32,  33, UNK,  35, 124, UNK, UNK,  93, 123,  67, UNK,  34, UNK,  45,  82, UNK,
  977.  91, UNK, UNK, UNK, 126, 117, UNK, UNK,  44, UNK, UNK,  34, 125,  92,  64,  63,
  978.  65,  65,  65,  65,  91,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  979. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  980.  97,  97,  97,  97,  97,  97,  97,  99, 101, 101, 101, 101, 105, 105, 105, 105,
  981. UNK, 110, 111, 111, 111, 111, 111,  47, 111, 117, 117, 117, 117, 121, UNK,  91
  982. };
  983.  
  984. CHAR
  985. yl1fi[] = {  /* Latin-1 to Finnish ISO 646 */
  986.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  987.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  988.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  989.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  990.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  991.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK,  95,
  992. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  993. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, UNK,
  994. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  995. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  996.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  997. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  998.  65,  65,  65,  65,  91,  93,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  999. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  94,  89, UNK, 115,
  1000.  97,  97,  97,  97, 123, 125,  97,  99, 101,  96, 101, 101, 105, 105, 105, 105,
  1001. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 126, 121, UNK, 121
  1002. };
  1003.  
  1004. CHAR
  1005. yl1fr[] = {  /* Latin-1 to French ISO 646 */
  1006.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1007.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1008.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1009.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1010. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1011.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1012.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1013. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1014. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1015. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1016.  32,  33, UNK,  35, UNK, UNK, UNK,  93,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1017.  91, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1018.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1019. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1020.  64,  97,  97,  97,  97,  97,  97,  92, 125, 123, 101, 101, 105, 105, 105, 105,
  1021. UNK, 110, 111, 111, 111, 111, 111,  47, 111, 124, 117, 117, 117, 121, UNK, 121
  1022. };
  1023.  
  1024. CHAR
  1025. yl1fc[] = {  /* Latin-1 to French-Canadian ISO 646 */
  1026.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1027.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1028.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1029.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1030. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1031.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK,  95,
  1032. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1033. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1034. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1035. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1036.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1037. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1038.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1039. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1040.  64,  97,  91,  97,  97,  97,  97,  92, 125, 123,  93, 101, 105, 105,  94, 105,
  1041. UNK, 110, 111, 111,  96, 111, 111,  47, 111, 124, 117, 126, 117, 121, UNK, 121
  1042. };
  1043.  
  1044. CHAR
  1045. yl1ge[] = {  /* Latin-1 to German ISO 646 */
  1046.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1047.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1048.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1049.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1050. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1051.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1052.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1053. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1054. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1055. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1056.  32,  33, UNK, UNK, UNK, UNK, UNK,  64,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1057. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1058.  65,  65,  65,  65,  91,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1059. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  93,  89, UNK, 126,
  1060.  97,  97,  97,  97, 123,  97,  97,  99, 101, 101, 101, 101, 105, 105, 105, 105,
  1061. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 125, 121, UNK, 121
  1062. };
  1063.  
  1064. CHAR
  1065. yl1hu[] = {  /* Latin-1 to Hungarian ISO-646 */
  1066.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1067.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1068.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1069.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1070.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1071.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1072.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1073. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1074. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1075. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1076.  32,  33, UNK, UNK,  36, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1077. UNK,  64, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1078.  65,  65,  65,  65,  65,  65,  65,  67,  69,  91,  69,  69,  73,  73,  73,  73,
  1079. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  93,  89, UNK, 115,
  1080.  97,  96,  97,  97,  97,  97,  97,  99, 101, 123, 101, 101, 105, 105, 105, 105,
  1081. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 125, 121, UNK, 121
  1082. };
  1083.  
  1084. CHAR
  1085. yl1it[] = {  /* Latin-1 to Italian ISO 646 */
  1086.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1087.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1088.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1089.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1090. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1091.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1092. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1093. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1094. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1095. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1096.  32,  33, UNK,  35, UNK, UNK, UNK,  64,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1097.  91, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1098.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1099. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1100. 123,  97,  97,  97,  97,  97,  97,  92, 125,  93, 101, 101, 126, 105, 105, 105,
  1101. UNK, 110, 124, 111, 111, 111, 111,  47, 111,  96, 117, 117, 117, 121, UNK, 121
  1102. };
  1103.  
  1104. CHAR
  1105. yl1ne[] = {  /* Latin-1 to NeXT */
  1106. /* NEED TO MAKE THIS ONE INVERTIBLE, LIKE CP850 */
  1107. /*
  1108.   Which means finding all the graphic characters in the NeXT set that have
  1109.   no equivalent in Latin-1 and assigning them to the UNK positions (mostly
  1110.   Latin-1 C1 controls).  Then make the ynel1[] table be the inverse of this
  1111.   one.  But first we should try to get an official Latin-1/NeXT translation
  1112.   table from NeXT, Inc.
  1113. */
  1114.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1115.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1116.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1117.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1118.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1119.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1120.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1121. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1122. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1123. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1124.  32, 161, 162, 163, 168, 165, 181, 167, 200, 160, 227, 171, 190, UNK, 176, 197,
  1125. 202, 209, 201, 204, 194, 157, 182, 183, 203, 192, 235, 187, 210, 211, 212, 191,
  1126. 129, 130, 131, 132, 133, 134, 225, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1127. 144, 145, 146, 147, 148, 149, 150, 158, 233, 151, 152, 153, 154, 155, 156, 251,
  1128. 213, 214, 215, 216, 217, 218, 241, 219, 220, 221, 222, 223, 224, 226, 228, 229,
  1129. 230, 231, 236, 237, 238, 239, 240, 159, 249, 242, 243, 244, 246, 247, 252, 253
  1130. };
  1131.  
  1132. CHAR
  1133. yl1no[] = {  /* Latin-1 to Norwegian/Danish ISO 646 */
  1134.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1135.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1136.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1137.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1138.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1139.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1140.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1141. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, 126, 127,
  1142. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1143. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1144.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1145. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1146.  65,  65,  65,  65,  65,  93,  91,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1147. UNK,  78,  79,  79,  79,  79,  79, 120,  92,  85,  85,  85,  85,  89, UNK, 115,
  1148.  97,  97,  97,  97,  97, 125, 123,  99, 101, 101, 101, 101, 105, 105, 105, 105,
  1149. UNK, 110, 111, 111, 111, 111, 111,  47, 124, 117, 117, 117, 117, 121, UNK, 121
  1150. };
  1151.  
  1152. CHAR
  1153. yl1po[] = {  /* Latin-1 to Portuguese ISO 646 */
  1154.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1155.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1156.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1157.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1158.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1159.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1160.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1161. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, 126, 127,
  1162. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1163. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1164.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1165. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1166.  65,  65,  65,  91,  65,  65,  65,  92,  69,  69,  69,  69,  73,  73,  73,  73,
  1167. UNK,  78,  79,  79,  79,  93,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1168.  97,  97,  97, 123,  97,  97,  97, 124, 101, 101, 101, 101, 105, 105, 105, 105,
  1169. UNK, 110, 111, 111, 111, 125, 111,  47, 111, 117, 117, 117, 117, 121, UNK, 121
  1170. };
  1171.  
  1172. CHAR
  1173. yl1sp[] = {  /* Latin-1 to Spanish ISO 646 */
  1174.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1175.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1176.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1177.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1178. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1179.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1180.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1181. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,  96, UNK, UNK, 126, 127,
  1182. 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1183. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1184.  32,  91, UNK,  35, UNK, UNK, UNK,  64,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1185. 123, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  93,
  1186.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1187. UNK,  92,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1188. 124,  97,  97,  97,  97,  97,  97, 125, 101, 101, 101, 101, 105, 105, 105, 105,
  1189. UNK, 124, 111, 111, 111, 111, 111,  47, 111, 117, 117, 117, 117, 121, UNK, 121
  1190. };
  1191.  
  1192. CHAR
  1193. yl1sw[] = {  /* Latin-1 to Swedish ISO 646 */
  1194.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1195.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1196.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1197.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1198. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1199.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK,  95,
  1200. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1201. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1202. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1203. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1204.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1205. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1206.  65,  65,  65,  65,  91,  93,  65,  67,  69,  64,  69,  69,  73,  73,  73,  73,
  1207. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  94,  89, UNK, 115,
  1208.  97,  97,  97,  97, 123, 125,  97,  99, 101,  96, 101, 101, 105, 105, 105, 105,
  1209. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 126, 121, UNK, 121
  1210. };
  1211.  
  1212. CHAR
  1213. yl1ch[] = {  /* Latin-1 to Swiss ISO 646 */
  1214.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1215.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1216.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1217.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1218. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1219.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK, UNK,
  1220.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1221. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1222. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1223. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1224.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1225. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1226.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1227. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1228.  64,  97,  97,  97, 123,  97,  97,  92,  95,  91,  93, 101, 105, 105,  94, 105,
  1229. UNK, 110, 111, 111,  96, 111, 124,  47, 111,  35, 117, 126, 125, 121, UNK, 121
  1230. };
  1231.  
  1232. CHAR
  1233. yl1dm[] = {  /* Latin-1 to DEC Multinational Character Set */
  1234.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1235.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1236.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1237.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1238.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1239.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1240.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1241. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1242. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1243. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1244.  32, 161, 162, 163, 168, 165, 124, 167,  34, 169, 170, 171, 126, UNK,  82, UNK,
  1245. 176, 177, 178, 179,  39, 181, 182, 183,  44, 185, 186, 187, 188, 189, UNK, 191,
  1246. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1247. UNK, 209, 210, 211, 212, 213, 214, 120, 216, 217, 218, 219, 220, 221, UNK, 223,
  1248. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1249. UNK, 241, 242, 243, 244, 245, 246,  47, 248, 249, 250, 251, 252, UNK, UNK, 253
  1250. };
  1251.  
  1252. CHAR
  1253. yl1dg[] = {  /* Latin-1 to Data General International Character Set */
  1254.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1255.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1256.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1257.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1258.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1259.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1260.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1261. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1262. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1263. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1264. 160, 171, 167, 168, 166, 181, 191, 187, 189, 173, 169, 177, 161, 255, 174, 175,
  1265. 188, 182, 164, 165, 190, 163, 178, 185, 186, 179, 170, 176, 223, 162, 220, 172,
  1266. 193, 192, 194, 196, 195, 197, 198, 199, 201, 200, 202, 203, 205, 204, 206, 207,
  1267. 184, 208, 210, 209, 211, 213, 212, 215, 214, 217, 216, 218, 219, 221, 222, 252,
  1268. 225, 224, 226, 228, 227, 229, 230, 231, 233, 232, 234, 235, 237, 236, 238, 239,
  1269. 183, 240, 242, 241, 243, 245, 244, 247, 246, 249, 248, 250, 251, 180, 254, 253
  1270. };
  1271.  
  1272.  
  1273. /* Local file character sets to ISO Latin Alphabet 1 */
  1274.  
  1275. #ifdef NOTUSED
  1276. CHAR
  1277. yasl1[] = {  /* ASCII to Latin-1 */
  1278.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1279.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1280.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1281.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1282.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1283.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1284.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1285. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127
  1286. };
  1287. #endif /* NOTUSED */
  1288.  
  1289. CHAR
  1290. yaql1[] = {  /* Extended Mac Latin (based on Apple Quickdraw) to Latin-1 */
  1291.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1292.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1293.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1294.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1295.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1296.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1297.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1298. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1299. 196, 197, 199, 201, 209, 214, 220, 225, 224, 226, 228, 227, 229, 231, 233, 232,
  1300. 234, 235, 237, 236, 238, 239, 241, 243, 242, 244, 246, 245, 250, 249, 251, 252,
  1301. 221, 176, 162, 163, 167, 215, 182, 223, 174, 169, 178, 180, 168, 179, 198, 216,
  1302. 185, 177, 188, 189, 165, 181, 128, 129, 130, 131, 190, 170, 186, 132, 230, 248,
  1303. 191, 161, 172, 142, 133, 134, 135, 171, 187, 166, 160, 192, 195, 213, 136, 137,
  1304. 173, 144, 138, 139, 143, 146, 247, 145, 255, 140, 141, 164, 208, 240, 222, 254,
  1305. 253, 183, 147, 148, 149, 194, 202, 193, 203, 200, 205, 206, 207, 204, 211, 212,
  1306. 150, 210, 218, 219, 217, 151, 152, 153, 175, 154, 155, 156, 184, 157, 158, 159
  1307. };
  1308.  
  1309. CHAR
  1310. ydul1[] = {  /* Dutch ISO 646 to Latin-1 */
  1311.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1312.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1313.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1314.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1315. 190,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1316.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 255, 189, 124,  94,  95,
  1317.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1318. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 168, 164, 188,  39, 127
  1319. };
  1320.  
  1321. CHAR
  1322. yfil1[] = {  /* Finnish ISO 646 to Latin-1 */
  1323.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1324.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1325.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1326.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1327.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1328.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 196, 214, 197, 220,  95,
  1329. 233,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1330. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 229, 252, 127
  1331. };
  1332.  
  1333. CHAR
  1334. yfrl1[] = {  /* French ISO 646 to Latin-1 */
  1335.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1336.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1337.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1338.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1339. 224,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1340.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 176, 231, 167,  94,  95,
  1341.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1342. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 249, 232, 168, 127
  1343. };
  1344.  
  1345. CHAR
  1346. yfcl1[] = {  /* French-Canadian ISO 646 to Latin-1 */
  1347.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1348.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1349.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1350.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1351. 224,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1352.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 226, 231, 234, 238,  95,
  1353. 244,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1354. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 249, 232, 251, 127
  1355. };
  1356.  
  1357. CHAR
  1358. ygel1[] = {  /* German ISO 646 to Latin-1 */
  1359.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1360.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1361.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1362.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1363. 167,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1364.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 196, 214, 220,  94,  95,
  1365.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1366. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 252, 223, 127
  1367. };
  1368.  
  1369. CHAR
  1370. yitl1[] = {  /* Italian ISO 646 to Latin-1 */
  1371.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1372.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1373.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1374.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1375. 167,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1376.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 176, 231, 233,  94,  95,
  1377. 249,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1378. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 224, 242, 232, 236, 127
  1379. };
  1380.  
  1381. CHAR
  1382. ynel1[] = {  /* NeXT to Latin-1 */
  1383. /* NEED TO MAKE THIS ONE INVERTIBLE */
  1384.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1385.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1386.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1387.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1388.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1389.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1390.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1391. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1392. 160, 192, 193, 194, 195, 196, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1393. 208, 209, 210, 211, 212, 213, 214, 217, 218, 219, 220, 221, 222, 181, 215, 247,
  1394. 169, 161, 162, 163, UNK, 165, UNK, 167, 164, UNK, UNK, 171, UNK, UNK, UNK, UNK,
  1395. 174, UNK, UNK, UNK, 183, 166, 182, UNK, UNK, UNK, UNK, 187, UNK, UNK, 172, 191,
  1396. 185,  96, 180,  94, 126, 175, UNK, UNK, 168, 178, 176, 184, 179, UNK, UNK, UNK,
  1397. UNK, 177, 188, 189, 190, 224, 225, 226, 227, 228, 229, 231, 232, 233, 234, 235,
  1398. 236, 198, 237, 170, 238, 239, 240, 241, UNK, 216, UNK, 186, 242, 243, 244, 245,
  1399. 246, 230, 249, 250, 251, UNK, 252, 253, UNK, 248, UNK, 223, 254, 255, UNK, UNK
  1400. };
  1401.  
  1402. CHAR
  1403. ynol1[] = {  /* Norwegian/Danish ISO 646 to Latin-1 */
  1404.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1405.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1406.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1407.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1408.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1409.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 198, 216, 197,  94,  95,
  1410.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1411. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 230, 248, 229, 126, 127
  1412. };
  1413.  
  1414. CHAR
  1415. ypol1[] = {  /* Portuguese ISO 646 to Latin-1 */
  1416.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1417.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1418.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1419.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1420.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1421.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 195, 199, 213,  94,  95,
  1422.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1423. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 227, 231, 245, 126, 127
  1424. };
  1425.  
  1426. CHAR
  1427. yspl1[] = {  /* Spanish ISO 646 to Latin-1 */
  1428.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1429.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1430.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1431.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1432. 167,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1433.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 161, 209, 191,  94,  95,
  1434.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1435. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 176, 241, 231, 126, 127
  1436. };
  1437.  
  1438. CHAR
  1439. yswl1[] = {  /* Swedish ISO 646 to Latin-1 */
  1440.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1441.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1442.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1443.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1444. 201,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1445.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 196, 214, 197, 220,  95,
  1446. 233,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1447. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 229, 252, 127
  1448. };
  1449.  
  1450. CHAR
  1451. ychl1[] = {  /* Swiss ISO 646 to Latin-1 */
  1452.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1453.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1454.  32,  33,  34, 249,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1455.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1456. 224,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1457.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 233, 231, 234, 238, 232,
  1458. 244,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1459. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 252, 251, 127
  1460. };
  1461.  
  1462. CHAR
  1463. yhul1[] = {  /* Hungarian ISO 646 to Latin-1 */
  1464.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1465.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1466.  32,  33,  34,  35, 164,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1467.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1468. 193,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1469.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 201, 214, 220,  94,  95,
  1470. 225,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1471. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 246, 252,  34, 127
  1472. };
  1473.  
  1474. CHAR
  1475. ydml1[] = {  /* DEC Multinational Character Set to Latin-1 */
  1476.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1477.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1478.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1479.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1480.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1481.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1482.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1483. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1484. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1485. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1486. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1487. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1488. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1489. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1490. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1491. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
  1492. };
  1493.  
  1494. CHAR
  1495. ydgl1[] = {  /* Data General International to Latin-1 */
  1496.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1497.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1498.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1499.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1500.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1501.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1502.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1503. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1504. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1505. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1506. 160, 172, 189, 181, 178, 179, 164, 162, 163, 170, 186, 161, 191, 169, 174, 175,
  1507. 187, 171, 182, 185, 253, 165, 177, 240, 208, 183, 184, 167, 176, 168, 180, 166,
  1508. 193, 192, 194, 196, 195, 197, 198, 199, 201, 200, 202, 203, 205, 204, 206, 207,
  1509. 209, 211, 210, 212, 214, 213, 216, 215, 218, 217, 219, 220, 190, 221, 222, 188,
  1510. 225, 224, 226, 228, 227, 229, 230, 231, 233, 232, 234, 235, 237, 236, 238, 239,
  1511. 241, 243, 242, 244, 246, 245, 248, 247, 250, 249, 251, 252, 223, 255, 254, 173
  1512. };
  1513.  
  1514.  
  1515. /* Translation tables for Cyrillic character sets */
  1516.  
  1517. #ifdef CYRILLIC
  1518. CHAR
  1519. ylcac[] = {  /* Latin/Cyrillic to CP866 */
  1520.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1521.  16,  17,  18,  19, 208, 209,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1522.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1523.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1524.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1525.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1526.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1527. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1528. 196, 179, 192, 217, 191, 218, 195, 193, 180, 194, 197, 176, 177, 178, 211, 216,
  1529. 205, 186, 200, 188, 187, 201, 204, 202, 185, 203, 206, 223, 220, 219, 254, UNK,
  1530. 255, 240, 132, 131, 242,  83,  73, 244,  74, 139, 141, 151, 138,  45, 246, 135,
  1531. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1532. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1533. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1534. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1535. 252, 241, 164, 163, 243, 115, 105, 245, 106, 171, 173, 231, 170,  21, 247, 167
  1536. };
  1537.  
  1538. CHAR
  1539. ylck8[] = {  /* Latin/Cyrillic to Old KOI-8 Cyrillic */
  1540.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1541.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1542.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1543.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1544.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1545.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1546.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1547. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1548. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1549. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1550. UNK, 229, UNK, UNK, UNK,  83,  73,  73,  74, UNK, UNK, UNK, 235, UNK, 245, UNK,
  1551. 225, 226, 247, 231, 228, 229, 246, 250, 233, 234, 235, 236, 237, 238, 239, 240,
  1552. 242, 243, 244, 245, 230, 232, 227, 254, 251, 253, 255, 249, 248, 252, 224, 241,
  1553. 193, 194, 215, 199, 196, 197, 214, 218, 201, 202, 203, 204, 205, 206, 207, 208,
  1554. 210, 211, 212, 213, 198, 200, 195, 222, 219, 221, 223, 217, 216, 220, 192, 209,
  1555. UNK, 197, UNK, UNK, UNK, 115, 105, 105, 106, UNK, UNK, UNK, 203, UNK, 213, UNK
  1556. };
  1557.  
  1558. CHAR
  1559. yaclc[] = {  /* CP866 to Latin/Cyrillic */
  1560. /* NEED TO MAKE THIS ONE INVERTIBLE */
  1561.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1562.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1563.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1564.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1565.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1566.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1567.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1568. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1569. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1570. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1571. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1572. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1573. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1574. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1575. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1576. 161, 241, 164, 244, 167, 247, 174, 254, UNK, UNK, UNK, UNK, 240, UNK, UNK, UNK
  1577. };
  1578.  
  1579. CHAR
  1580. yk8lc[] = {  /* Old KOI-8 Cyrillic to Latin/Cyrillic */
  1581.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1582.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1583.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1584.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1585.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1586.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1587.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1588. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1589. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1590. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1591. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1592. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1593. 238, 208, 209, 230, 212, 213, 228, 211, 229, 216, 217, 218, 219, 220, 221, 222,
  1594. 223, 239, 224, 225, 226, 227, 214, 210, 236, 235, 215, 232, 237, 233, 231, 234,
  1595. 206, 176, 177, 198, 180, 181, 196, 179, 197, 184, 185, 186, 187, 188, 189, 190,
  1596. 191, 207, 192, 193, 194, 195, 182, 178, 204, 203, 183, 200, 205, 201, 199, 127
  1597. };
  1598.  
  1599. CHAR
  1600. ylcsk[] = {  /* Latin/Cyrillic to Short KOI */
  1601.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1602.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1603.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1604.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1605.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1606.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1607.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1608.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94, 127,
  1609.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1610.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1611.  32, 101, UNK, UNK, UNK,  83,  73,  73,  74, UNK, UNK, UNK, 107,  45, 117, UNK,
  1612.  97,  98, 119, 103, 100, 101, 118, 122, 105, 106, 107, 108, 109, 110, 111, 112,
  1613. 114, 115, 116, 117, 102, 104,  99, 126, 123, 125,  39, 121, 120, 124,  96, 113,
  1614.  97,  98, 119, 103, 100, 101, 118, 122, 105, 106, 107, 108, 109, 110, 111, 112,
  1615. 114, 115, 116, 117, 102, 104,  99, 126, 123, 125,  39, 121, 120, 124,  96, 113,
  1616. UNK, 101, UNK, UNK, UNK,  83,  73,  73,  74, UNK, UNK, UNK, 107, UNK, 117, UNK
  1617. };
  1618.  
  1619. CHAR yskcy[] = {  /* Short KOI to Latin/Cyrillic */
  1620.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1621.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1622.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1623.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1624.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1625.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1626. 206, 176, 177, 198, 180, 181, 196, 179, 197, 184, 185, 186, 187, 188, 189, 190,
  1627. 191, 207, 192, 193, 194, 195, 182, 178, 204, 203, 183, 200, 205, 201, 199, 127
  1628. };
  1629. #endif /* CYRILLIC */
  1630.  
  1631. #ifdef LATIN2
  1632.  
  1633. /* Latin-2 tables */
  1634.  
  1635. CHAR
  1636. yl252[] = {  /* Latin-2 to Code Page 852 */
  1637.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1638.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1639.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1640.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1641.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1642.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1643.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1644. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1645. 174, 175, 176, 177, 178, 179, 180, 185, 186, 187, 188, 191, 192, 193, 194, 195,
  1646. 196, 197, 200, 201, 202, 203, 204, 205, 206, 217, 218, 219, 220, 223, 240, 254,
  1647. 255, 164, 244, 157, 207, 149, 151, 245, 249, 230, 184, 155, 141, 170, 166, 189,
  1648. 248, 165, 242, 136, 239, 150, 152, 243, 247, 231, 173, 156, 171, 241, 167, 190,
  1649. 232, 181, 182, 198, 142, 145, 143, 128, 172, 144, 168, 211, 183, 214, 215, 210,
  1650. 209, 227, 213, 224, 226, 138, 153, 158, 252, 222, 233, 235, 154, 237, 221, 225,
  1651. 234, 160, 131, 199, 132, 146, 134, 135, 159, 130, 169, 137, 216, 161, 140, 212,
  1652. 208, 228, 229, 162, 147, 139, 148, 246, 253, 133, 163, 251, 129, 236, 238, 250
  1653. };
  1654.  
  1655. CHAR
  1656. y52l2[] = {  /* Code Page 852 to Latin-2 */
  1657.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1658.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1659.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1660.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1661.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1662.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1663.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1664. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1665. 199, 252, 233, 226, 228, 249, 230, 231, 179, 235, 213, 245, 238, 172, 196, 198,
  1666. 201, 197, 229, 244, 246, 165, 181, 166, 182, 214, 220, 171, 187, 163, 215, 232,
  1667. 225, 237, 243, 250, 161, 177, 174, 190, 202, 234, 173, 188, 200, 186, 128, 129,
  1668. 130, 131, 132, 133, 134, 193, 194, 204, 170, 135, 136, 137, 138, 175, 191, 139,
  1669. 140, 141, 142, 143, 144, 145, 195, 227, 146, 147, 148, 149, 150, 151, 152, 164,
  1670. 240, 208, 207, 203, 239, 210, 205, 206, 236, 153, 154, 155, 156, 222, 217, 157,
  1671. 211, 223, 212, 209, 241, 242, 169, 185, 192, 218, 224, 219, 253, 221, 254, 180,
  1672. 158, 189, 178, 183, 162, 167, 247, 184, 176, 168, 255, 251, 216, 248, 159, 160
  1673. };
  1674.  
  1675. CHAR
  1676. yl2l1[] = {  /* Latin-2 to Latin-1 */
  1677.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1678.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1679.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1680.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1681.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1682.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1683.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1684. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1685. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1686. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1687. 160, 'A', UNK, 'L', 164, 'L', 'S', 167, 168, 'S', 'S', 'T', 'Z', 173, 'Z', 'Z',
  1688. 176, 'a', UNK, 'l', 180, 'l', 's', UNK, 184, 's', 's', 't', 'z', UNK, 'z', 'z',
  1689. 'R', 193, 194, 'A', 196, 'L', 'C', 199, 'C', 201, 'E', 203, 'E', 205, 'I', 'D',
  1690. 208, 'N', 'N', 211, 212, 'O', 214, 215, 'R', 'U', 218, 'U', 220, 221, 'T', 's',
  1691. 'r', 225, 226, 'a', 228, 'l', 'c', 231, 'c', 233, 'e', 235, 'e', 237, 'i', 'd',
  1692. 240, 'n', 'n', 243, 244, 'o', 246, 247, 'r', 'u', 250, 'u', 252, 253, 't', '.'
  1693. };
  1694.  
  1695. CHAR
  1696. yl1l2[] = {  /* Latin-1 to Latin-2 */
  1697.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1698.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1699.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1700.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1701.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1702.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1703.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1704. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1705. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1706. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1707. 160, 'A', UNK, 'L', 164, UNK, UNK, 167, 168, 'C', 'a', '<', '>', 173, 'R', UNK,
  1708. 176, UNK, UNK, UNK, 180, UNK, UNK, UNK, 184, UNK, 'o', '>', UNK, UNK, UNK, UNK,
  1709. 'A', 193, 194, 'A', 196, 'A', 'A', 199, 'E', 201, 'E', 203, 'I', 205, 'I', 'I',
  1710. 208, 'N', 'O', 211, 212, 'O', 214, 215, 'O', 'U', 218, 'U', 220, 221, UNK, 223,
  1711. 'a', 225, 226, 'a', 228, 'a', 'a', 231, 'e', 233, 'e', 235, 'i', 237, 'i', 'i',
  1712. 240, 'n', 'o', 243, 244, 'o', 246, 247, 'o', 'u', 250, 'u', 252, 253, UNK, 'y'
  1713. };
  1714.  
  1715. CHAR
  1716. yl2as[] = {  /* Latin-2 to ASCII */
  1717.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1718.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1719.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1720.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1721.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1722.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1723.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1724. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1725. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1726. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1727.  32, 'A', UNK, 'L', UNK, 'L', 'S', UNK,  34, 'S', 'S', 'T', 'Z', '-', 'Z', 'Z',
  1728. UNK, 'a', UNK, 'l',  39, 'l', 's', UNK,  44, 's', 's', 't', 'z', UNK, 'z', 'z',
  1729. 'R', 'A', 'A', 'A', 'A', 'L', 'C', 'C', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'D',
  1730. 'D', 'N', 'N', 'O', 'O', 'O', 'O', 'x', 'R', 'U', 'U', 'U', 'U', 'Y', 'T', 's',
  1731. 'r', 'a', 'a', 'a', 'a', 'l', 'c', 'c', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'd',
  1732. 'd', 'n', 'n', 'o', 'o', 'o', 'o', '/', 'r', 'u', 'u', 'u', 'u', 'y', 't', '.'
  1733. };
  1734. #endif /* LATIN2 */
  1735.  
  1736. #ifdef HEBREW
  1737. /*
  1738.   8-bit Tables providing invertible translation between Latin/Hebrew and CP862.
  1739. */
  1740. CHAR
  1741. y62lh[] = {  /* PC Code Page 862 to ISO 8859-8 Latin/Hebrew */
  1742.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1743.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1744.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1745.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1746.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1747.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1748.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1749. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1750. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1751. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 162, 163, 165, 128, 129,
  1752. 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 172, 189, 188, 140, 171, 187,
  1753. 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
  1754. 157, 158, 159, 161, 164, 166, 167, 168, 169, 170, 173, 174, 175, 223, 179, 180,
  1755. 182, 184, 185, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
  1756. 203, 204, 205, 206, 207, 208, 181, 209, 210, 211, 212, 213, 214, 215, 216, 217,
  1757. 218, 177, 219, 220, 221, 222, 186, 251, 176, 183, 252, 253, 254, 178, 255, 160
  1758. };
  1759.  
  1760. CHAR
  1761. ylh62[] = {  /* ISO 8859-8 Latin/Hebrew to PC Code Page 862 */
  1762.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1763.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1764.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1765.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1766.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1767.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1768.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1769. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1770. 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 173, 176, 177, 178,
  1771. 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
  1772. 255, 195, 155, 156, 196, 157, 197, 198, 199, 200, 201, 174, 170, 202, 203, 204,
  1773. 248, 241, 253, 206, 207, 230, 208, 249, 209, 210, 246, 175, 172, 171, 211, 212,
  1774. 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
  1775. 229, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 242, 243, 244, 245, 205,
  1776. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1777. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 247, 250, 251, 252, 254
  1778. };
  1779. /*
  1780.   7-bit table providing readable translation from DEC Hebrew-7 to CP862.
  1781. */
  1782. CHAR
  1783. yh762[] = {
  1784.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1785.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1786.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1787.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1788.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1789.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1790. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1791.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 123, 124, 125, 126, 127
  1792. };
  1793. /*
  1794.   8-bit table providing readable translation from CP862 to Hebrew-7.
  1795. */
  1796. CHAR
  1797. y62h7[] = {  /* PC Code Page 862 to Hebrew-7 */
  1798.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1799.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1800.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1801.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1802.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1803.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  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, 123, 124, 125, 126, 127,
  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, UNK, UNK, UNK, UNK, UNK,
  1808. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1809. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1810. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  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. };
  1815. /*
  1816.   7-bit table providing readable translation from Hebrew-7 to ISO Latin/Hebrew.
  1817. */
  1818. CHAR
  1819. yh7lh[] = {
  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. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1827. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 123, 124, 125, 126, 127
  1828. };
  1829. /*
  1830.   8-bit table providing readable translation from ISO Latin/Hebrew to Hebrew-7.
  1831. */
  1832. CHAR
  1833. ylhh7[] = {  /* Latin/Hebrew to Hebrew-7 */
  1834.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1835.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1836.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1837.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1838.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1839.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1840.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1841.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 123, 124, 125, 126, 127,
  1842. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1843. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1844. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1845. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1846. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1847. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1848.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1849. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, UNK
  1850. };
  1851. #endif /* HEBREW */
  1852.  
  1853. /* Translation functions ... */
  1854.  
  1855. CHAR                /* The identity translation function.  */
  1856. #ifdef CK_ANSIC
  1857. ident(CHAR c)                /* (no longer used) */
  1858. #else
  1859. ident(c) CHAR c;
  1860. #endif /* CK_ANSIC */
  1861. { /* ident */
  1862.     return(c);                /* Instead, enter NULL in the  */
  1863. }                    /* table of functions to avoid */
  1864.                     /* needless function calls.    */
  1865. CHAR
  1866. #ifdef CK_ANSIC
  1867. xl1as(CHAR c) 
  1868. #else
  1869. xl1as(c) CHAR c; 
  1870. #endif /* CK_ANSIC */
  1871. { /* xl1as */             /* Latin-1 to US ASCII... */
  1872.     switch(langs[language].id) {
  1873.  
  1874.       case L_DUTCH:
  1875.     if (c == 255) {            /* Dutch umlaut-y */
  1876.         zmstuff('j');        /* becomes ij */
  1877.         return('i');
  1878.     } else return(yl1as[c]);    /* all others by the book */
  1879.  
  1880.       case L_GERMAN:
  1881.     switch (c) {            /* German, special rules. */
  1882.       case 196:            /* umlaut-A -> Ae */
  1883.         zmstuff('e');
  1884.         return('A');
  1885.       case 214:            /* umlaut-O -> Oe */
  1886.         zmstuff('e');
  1887.         return('O');
  1888.       case 220:            /* umlaut-U -> Ue */
  1889.         zmstuff('e');
  1890.         return('U');
  1891.       case 228:            /* umlaut-a -> ae */
  1892.         zmstuff('e');
  1893.         return('a');
  1894.       case 246:            /* umlaut-o -> oe */
  1895.         zmstuff('e');
  1896.         return('o');
  1897.       case 252:            /* umlaut-u -> ue */
  1898.         zmstuff('e');
  1899.         return('u');
  1900.       case 223:            /* ess-zet -> ss */
  1901.         zmstuff('s');
  1902.         return('s');
  1903.       default: return(yl1as[c]);    /* all others by the book */
  1904.     }
  1905.       case L_DANISH:
  1906.       case L_FINNISH:
  1907.       case L_NORWEGIAN:
  1908.       case L_SWEDISH:
  1909.     switch (c) {            /* Scandanavian languages. */
  1910.       case 196:            /* umlaut-A -> Ae */
  1911.           case 198:            /* AE ligature also -> Ae */
  1912.         zmstuff('e');
  1913.         return('A');
  1914.       case 214:            /* umlaut-O -> Oe */
  1915.       case 216:            /* O-slash -> Oe */
  1916.         zmstuff('e');
  1917.         return('O');
  1918.       case 220:            /* umlaut-U -> Ue */
  1919.       /*  return('Y'); replaced by "Ue" by popular demand. */
  1920.           /*  Y for Umlaut-U is only used in German names. */
  1921.         zmstuff('e');
  1922.         return('U');
  1923.       case 228:            /* umlaut-a -> ae */
  1924.           case 230:            /* ditto for ae ligature */
  1925.         zmstuff('e');
  1926.         return('a');
  1927.       case 246:            /* umlaut-o -> oe */
  1928.       case 248:            /* o-slash -> oe */
  1929.         zmstuff('e');
  1930.         return('o');
  1931.       case 252:            /* umlaut-u -> ue */
  1932.       /*  return('y'); replaced by "ue" by popular demand. */
  1933.         zmstuff('e');
  1934.         return('u');
  1935.       case 197:            /* A-ring -> Aa */
  1936.         zmstuff('a');
  1937.         return('A');
  1938.           case 229:            /* a-ring -> aa */
  1939.         zmstuff('a');
  1940.         return('a');
  1941.       default: return(yl1as[c]);    /* All others by the book */
  1942.     }
  1943.       case L_ICELANDIC:            /* Icelandic. */
  1944.     switch (c) {    
  1945.       case 198:            /* uppercase AE -> AE */
  1946.         zmstuff('e');
  1947.         return('A');
  1948.       case 208:            /* uppercase Eth -> D */
  1949.         return('D');
  1950.       case 214:            /* uppercase O-diaeresis -> Oe */
  1951.         zmstuff('e');
  1952.         return('O');
  1953.       case 222:            /* uppercase Thorn -> Th */
  1954.         zmstuff('h');
  1955.         return('T');
  1956.       case 230:            /* lowercase ae -> ae */
  1957.         zmstuff('e');
  1958.         return('a');
  1959.       case 240:            /* lowercase Eth -> d */
  1960.         return('d');
  1961.       case 246:            /* lowercase O-diaeresis -> oe */
  1962.         zmstuff('e');
  1963.         return('o');
  1964.       case 254:            /* lowercase Thorn -> th */
  1965.         zmstuff('h');
  1966.         return('t');
  1967.       default: return(yl1as[c]);    /* All others by the book */
  1968.     }
  1969.       default:
  1970.     return(yl1as[c]);        /* None of the above, by the table. */
  1971.     }
  1972. }
  1973.  
  1974. CHAR                    /* Latin-1 to German */
  1975. #ifdef CK_ANSIC
  1976. xl1ge(CHAR c) 
  1977. #else
  1978. xl1ge(c) CHAR c; 
  1979. #endif /* CK_ANSIC */
  1980. { /* xl1ge */
  1981.     return(yl1ge[c]);
  1982. }
  1983.  
  1984. CHAR                    /* German to Latin-1 */
  1985. #ifdef CK_ANSIC
  1986. xgel1(CHAR c) 
  1987. #else
  1988. xgel1(c) CHAR c; 
  1989. #endif /* CK_ANSIC */
  1990. { /* xgel1 */
  1991.     return(ygel1[c]);
  1992. }
  1993.  
  1994. CHAR
  1995. #ifdef CK_ANSIC
  1996. xgeas(CHAR c) 
  1997. #else
  1998. xgeas(c) CHAR c; 
  1999. #endif /* CK_ANSIC */
  2000. { /* xgeas */            /* German ISO 646 to ASCII */
  2001.     switch (c) {
  2002.       case 91:                /* umlaut-A -> Ae */
  2003.     zmstuff('e');
  2004.     return('A');
  2005.       case 92:                /* umlaut-O -> Oe */
  2006.     zmstuff('e');
  2007.     return('O');
  2008.       case 93:                /* umlaut-U -> Ue */
  2009.     zmstuff('e');
  2010.     return('U');
  2011.       case 123:                /* umlaut-a -> ae */
  2012.     zmstuff('e');
  2013.     return('a');
  2014.       case 124:                /* umlaut-o -> oe */
  2015.     zmstuff('e');
  2016.     return('o');
  2017.       case 125:                /* umlaut-u -> ue */
  2018.     zmstuff('e');
  2019.     return('u');
  2020.       case 126:                /* ess-zet -> ss */
  2021.     zmstuff('s');
  2022.     return('s');
  2023.       default:  return(c);        /* all others stay the same */
  2024.     }
  2025. }
  2026.  
  2027. CHAR
  2028. #ifdef CK_ANSIC
  2029. xduas(CHAR c) 
  2030. #else
  2031. xduas(c) CHAR c; 
  2032. #endif /* CK_ANSIC */
  2033. { /* xduas */            /* Dutch ISO 646 to US ASCII */
  2034.     switch (c) {
  2035.       case 64:  return(UNK);        /* 3/4 */
  2036.       case 91:                /* y-diaeresis */
  2037.     zmstuff('j');
  2038.     return('i');
  2039.       case 92:  return(UNK);        /* 1/2 */
  2040.       case 93:  return(124);        /* vertical bar */
  2041.       case 123: return(34);        /* diaeresis */
  2042.       case 124: return(UNK);        /* Florin */
  2043.       case 125: return(UNK);        /* 1/4 */
  2044.       case 126: return(39);        /* Apostrophe */
  2045.       default:  return(c);
  2046.     }
  2047. }
  2048.  
  2049. CHAR
  2050. #ifdef CK_ANSIC
  2051. xfias(CHAR c) 
  2052. #else
  2053. xfias(c) CHAR c; 
  2054. #endif /* CK_ANSIC */
  2055. { /* xfias */            /* Finnish ISO 646 to US ASCII */
  2056.     switch (c) {
  2057.       case 91:                /* A-diaeresis */
  2058.     zmstuff('e');
  2059.     return('A');
  2060.       case 92:                /* O-diaeresis */
  2061.     zmstuff('e');
  2062.     return('O');
  2063.       case 93:                /* A-ring */
  2064.     zmstuff('a');
  2065.     return('A');
  2066.       case 94:                /* U-diaeresis */
  2067.     /* return('Y'); */
  2068.     zmstuff('e');
  2069.     return('U');
  2070.       case 96:                /* e-acute */
  2071.     return('e');
  2072.       case 123:                /* a-diaeresis */
  2073.     zmstuff('e');
  2074.     return('a');
  2075.       case 124:                /* o-diaeresis */
  2076.     zmstuff('e');
  2077.     return('o');
  2078.       case 125:                /* a-ring */
  2079.     zmstuff('a');
  2080.     return('a');
  2081.       case 126:                /* u-diaeresis */
  2082.     /* return('y'); */
  2083.     zmstuff('e');
  2084.     return('U');
  2085.       default:
  2086.     return(c);
  2087.     }
  2088. }
  2089.  
  2090. CHAR
  2091. #ifdef CK_ANSIC
  2092. xfras(CHAR c) 
  2093. #else
  2094. xfras(c) CHAR c; 
  2095. #endif /* CK_ANSIC */
  2096. { /* xfras */            /* French ISO 646 to US ASCII */
  2097.     switch (c) {
  2098.       case 64:  return(97);        /* a grave */
  2099.       case 91:  return(UNK);        /* degree sign */
  2100.       case 92:  return(99);        /* c cedilla */
  2101.       case 93:  return(UNK);        /* paragraph sign */
  2102.       case 123: return(101);        /* e acute */
  2103.       case 124: return(117);        /* u grave */
  2104.       case 125: return(101);        /* e grave */
  2105.       case 126: return(34);        /* diaeresis */
  2106.       default:  return(c);
  2107.     }
  2108. }
  2109.  
  2110. CHAR
  2111. #ifdef CK_ANSIC
  2112. xfcas(CHAR c) 
  2113. #else
  2114. xfcas(c) CHAR c; 
  2115. #endif /* CK_ANSIC */
  2116. { /* xfcas */            /* French Canadian ISO 646 to ASCII */
  2117.     switch (c) {
  2118.       case 64:  return('a');        /* a grave */
  2119.       case 91:  return('a');        /* a circumflex */
  2120.       case 92:  return('c');        /* c cedilla */
  2121.       case 93:  return('e');        /* e circumflex */
  2122.       case 94:  return('i');        /* i circumflex */
  2123.       case 96:  return('o');        /* o circumflex */
  2124.       case 123: return('e');        /* e acute */
  2125.       case 124: return('u');        /* u grave */
  2126.       case 125: return('e');        /* e grave */
  2127.       case 126: return('u');        /* u circumflex */
  2128.       default:  return(c);
  2129.     }
  2130. }
  2131.  
  2132. CHAR
  2133. #ifdef CK_ANSIC
  2134. xitas(CHAR c) 
  2135. #else
  2136. xitas(c) CHAR c; 
  2137. #endif /* CK_ANSIC */
  2138. { /* xitas */            /* Italian ISO 646 to ASCII */
  2139.     switch (c) {
  2140.       case 91:  return(UNK);        /* degree */
  2141.       case 92:  return('c');        /* c cedilla */
  2142.       case 93:  return('e');        /* e acute */
  2143.       case 96:  return('u');        /* u grave */
  2144.       case 123: return('a');        /* a grave */
  2145.       case 124: return('o');        /* o grave */
  2146.       case 125: return('e');        /* e grave */
  2147.       case 126: return('i');        /* i grave */
  2148.       default:  return(c);
  2149.     }
  2150. }
  2151.  
  2152. CHAR
  2153. #ifdef CK_ANSIC
  2154. xneas(CHAR c) 
  2155. #else
  2156. xneas(c) CHAR c; 
  2157. #endif /* CK_ANSIC */
  2158. { /* xneas */            /* NeXT to ASCII */
  2159.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2160.     if (c == 234) {            /* handle OE digraph. */
  2161.         zmstuff('E');
  2162.         return('O');
  2163.     } else if (c == 250) {        /* Also lowercase oe. */
  2164.         zmstuff('e');
  2165.         return('o');
  2166.     }
  2167.     }
  2168.     c = xnel1(c);            /* Convert to Latin-1 */
  2169.     return(yl1as[c]);            /* Convert Latin-1 to ASCII */
  2170. }
  2171.  
  2172. CHAR
  2173. #ifdef CK_ANSIC
  2174. xnoas(CHAR c) 
  2175. #else
  2176. xnoas(c) CHAR c; 
  2177. #endif /* CK_ANSIC */
  2178. { /* xnoas */            /* Norge/Danish ISO 646 to ASCII */
  2179.     switch (c) {
  2180.       case 91:
  2181.     zmstuff('E');            /* AE digraph */
  2182.     return('A');
  2183.       case 92: return('O');        /* O slash */
  2184.       case 93:                /* A ring */
  2185.     zmstuff('a');
  2186.     return('A');
  2187.       case 123:                /* ae digraph */
  2188.     zmstuff('e');
  2189.     return('a');
  2190.       case 124: return('o');        /* o slash */
  2191.       case 125:                /* a ring */
  2192.     zmstuff('a');
  2193.     return('a');
  2194.       default:  return(c);
  2195.     }
  2196. }
  2197.  
  2198. CHAR
  2199. #ifdef CK_ANSIC
  2200. xpoas(CHAR c) 
  2201. #else
  2202. xpoas(c) CHAR c; 
  2203. #endif /* CK_ANSIC */
  2204. { /* xpoas */            /* Portuguese ISO 646 to ASCII */
  2205.     switch (c) {
  2206.       case 91:  return('A');        /* A tilde */
  2207.       case 92:  return('C');        /* C cedilla */
  2208.       case 93:  return('O');        /* O tilde */
  2209.       case 123: return('a');        /* a tilde */
  2210.       case 124: return('c');        /* c cedilla */
  2211.       case 125: return('o');        /* o tilde */
  2212.       default:  return(c);
  2213.     }
  2214. }
  2215.  
  2216. CHAR
  2217. #ifdef CK_ANSIC
  2218. xspas(CHAR c) 
  2219. #else
  2220. xspas(c) CHAR c; 
  2221. #endif /* CK_ANSIC */
  2222. { /* xspas */            /* Spanish ISO 646 to ASCII */
  2223.     switch (c) {
  2224.       case 91:  return(33);        /* Inverted exclamation */
  2225.       case 92:  return('N');        /* N tilde */
  2226.       case 93:  return(63);        /* Inverted question mark */
  2227.       case 123: return(UNK);        /* degree */
  2228.       case 124: return('n');        /* n tilde */
  2229.       case 125: return('c');        /* c cedilla */
  2230.       default:  return(c);
  2231.     }
  2232. }
  2233.  
  2234. CHAR
  2235. #ifdef CK_ANSIC
  2236. xswas(CHAR c) 
  2237. #else
  2238. xswas(c) CHAR c; 
  2239. #endif /* CK_ANSIC */
  2240. { /* xswas */            /* Swedish ISO 646 to ASCII */
  2241.     switch (c) {
  2242.       case 64:  return('E');        /* E acute */
  2243.       case 91:                /* A diaeresis */
  2244.     zmstuff('e');
  2245.     return('A');
  2246.       case 92:                /* O diaeresis */
  2247.     zmstuff('e');
  2248.     return('O');
  2249.       case 93:                /* A ring */
  2250.     zmstuff('a');
  2251.     return('A');
  2252.       case 94:                /* U diaeresis */
  2253.     /* return('Y'); */
  2254.     zmstuff('e');
  2255.     return('U');
  2256.       case 96:  return('e');        /* e acute */
  2257.       case 123:                /* a diaeresis */
  2258.     zmstuff('e');
  2259.     return('a');
  2260.       case 124:                /* o diaeresis */
  2261.     zmstuff('e');
  2262.     return('o');
  2263.       case 125:                /* a ring */
  2264.     zmstuff('a');
  2265.     return('a');
  2266.       case 126:                /* u diaeresis */
  2267.     /* return('y'); */
  2268.     zmstuff('e');
  2269.     return('u');
  2270.       default:  return(c);
  2271.     }
  2272. }
  2273.  
  2274. CHAR
  2275. #ifdef CK_ANSIC
  2276. xchas(CHAR c) 
  2277. #else
  2278. xchas(c) CHAR c; 
  2279. #endif /* CK_ANSIC */
  2280. { /* xchas */            /* Swiss ISO 646 to ASCII */
  2281.     switch (c) {
  2282.       case 35:  return('u');        /* u grave */
  2283.       case 64:  return('a');        /* a grave */
  2284.       case 91:  return('e');        /* e acute */
  2285.       case 92:  return('c');        /* c cedilla */
  2286.       case 93:  return('e');        /* e circumflex */
  2287.       case 94:  return('i');        /* i circumflex */
  2288.       case 95:  return('e');        /* e grave */
  2289.       case 96:  return('o');        /* o circumflex */
  2290.       case 123:                /* a diaeresis */
  2291.     zmstuff('e');
  2292.     return('a');
  2293.       case 124:                /* o diaeresis */
  2294.     zmstuff('e');
  2295.     return('o');
  2296.       case 125:                /* u diaeresis */
  2297.     zmstuff('e');
  2298.     return('u');
  2299.       case 126: return('u');        /* u circumflex */
  2300.       default:  return(c);
  2301.     }
  2302. }
  2303.  
  2304. CHAR
  2305. #ifdef CK_ANSIC
  2306. xhuas(CHAR c) 
  2307. #else
  2308. xhuas(c) CHAR c; 
  2309. #endif /* CK_ANSIC */
  2310. { /* xhuas */            /* Hungarian ISO 646 to ASCII */
  2311.     switch (c) {
  2312.       case 64:  return('A');        /* A acute */
  2313.       case 91:  return('E');        /* E acute */
  2314.       case 92:  return('O');        /* O diaeresis */
  2315.       case 93:  return('U');        /* U diaeresis */
  2316.       case 96:  return('a');        /* a acute */
  2317.       case 123: return('e');        /* e acute */
  2318.       case 124: return('o');        /* o acute */
  2319.       case 125: return('u');        /* u acute */
  2320.       case 126: return(34);        /* double acute accent */
  2321.       default:  return(c);
  2322.     }
  2323. }
  2324.  
  2325. CHAR
  2326. #ifdef CK_ANSIC
  2327. xdmas(CHAR c) 
  2328. #else
  2329. xdmas(c) CHAR c; 
  2330. #endif /* CK_ANSIC */
  2331. { /* xdmas */            /* DEC MCS to ASCII */
  2332.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2333.     if (c == 215) {            /* handle OE digraph. */
  2334.         zmstuff('E');
  2335.         return('O');
  2336.     } else if (c == 247) {        /* Also lowercase oe. */
  2337.         zmstuff('e');
  2338.         return('o');
  2339.     }
  2340.     }
  2341.     return(yl1as[c]);            /* Otherwise treat like Latin-1 */
  2342. }
  2343.  
  2344. CHAR
  2345. #ifdef CK_ANSIC
  2346. xdgas(CHAR c)
  2347. #else
  2348. xdgas(c) CHAR c;
  2349. #endif /* CK_ANSIC */
  2350. { /*  xdgas */            /* Data General to ASCII */
  2351.     switch(c) {
  2352.       case 180: return('f');        /* Florin */
  2353.       case 183: return('<');        /* Less-equal */
  2354.       case 184: return('>');        /* Greater-equal */
  2355.       case 186: return(96);        /* Grave accent */
  2356.       case 191: return('^');        /* Uparrow */
  2357.       case 215:
  2358.     if (langs[language].id == L_FRENCH) { /* OE digraph */
  2359.         zmstuff('E');
  2360.         return('O');
  2361.     } else return('O');
  2362.       case 247:
  2363.     if (langs[language].id == L_FRENCH) { /* oe digraph */
  2364.         zmstuff('e');
  2365.         return('o');
  2366.     } else return('o');
  2367.       case 175: case 179: case 220: case 222:
  2368.       case 223: case 254: case 255:
  2369.     return(UNK);
  2370.       default:                /* The rest, convert to Latin-1 */
  2371.     return(yl1as[ydgl1[c]]);    /* and from there to ASCII */
  2372.     }
  2373. }
  2374.  
  2375. CHAR
  2376. #ifdef CK_ANSIC
  2377. xr8as(CHAR c)
  2378. #else
  2379. xr8as(c) CHAR c;
  2380. #endif /* CK_ANSIC */
  2381. { /*  xr8as */                /* Hewlett Packard Roman8 to ASCII */
  2382.     switch(c) {
  2383.       case 175: return('L');        /* Lira */
  2384.       case 190: return('f');        /* Florin */
  2385.       case 235: return('S');        /* S caron */
  2386.       case 236: return('s');        /* s caron */
  2387.       case 246: return('-');        /* Horizontal bar */
  2388.       case 252: return('*');        /* Solid box */
  2389.       default:                /* The rest, convert to Latin-1 */
  2390.     return(yl1as[yr8l1[c]]);    /* and from there to ASCII */
  2391.     }
  2392. }
  2393.  
  2394. CHAR
  2395. #ifdef CK_ANSIC
  2396. xukl1(CHAR c) 
  2397. #else
  2398. xukl1(c) CHAR c; 
  2399. #endif /* CK_ANSIC */
  2400. { /* xukl1 */            /* UK ASCII to Latin-1 */
  2401.     if (c == 35)
  2402.       return(163);
  2403.     else return(c);
  2404. }
  2405.  
  2406. CHAR
  2407. #ifdef CK_ANSIC
  2408. xl1uk(CHAR c) 
  2409. #else
  2410. xl1uk(c) CHAR c; 
  2411. #endif /* CK_ANSIC */
  2412. { /* xl1uk */            /* Latin-1 to UK ASCII */
  2413.     if (c == 163)
  2414.       return(35);
  2415.     else return(yl1as[c]);
  2416. }
  2417.  
  2418. CHAR                    /* Latin-1 to French ISO 646 */
  2419. #ifdef CK_ANSIC
  2420. xl1fr(CHAR c) 
  2421. #else
  2422. xl1fr(c) CHAR c; 
  2423. #endif /* CK_ANSIC */
  2424. { /* xl1fr */
  2425.     return(yl1fr[c]);
  2426. }
  2427.  
  2428.  
  2429. CHAR                    /* French ASCII to Latin-1 */
  2430. #ifdef CK_ANSIC
  2431. xfrl1(CHAR c) 
  2432. #else
  2433. xfrl1(c) CHAR c; 
  2434. #endif /* CK_ANSIC */
  2435. { /* xfrl1 */
  2436.     return(yfrl1[c]);
  2437. }
  2438.  
  2439. CHAR                    /* Latin-1 to Dutch ASCII */
  2440. #ifdef CK_ANSIC
  2441. xl1du(CHAR c) 
  2442. #else
  2443. xl1du(c) CHAR c; 
  2444. #endif /* CK_ANSIC */
  2445. { /* xl1du */
  2446.     return(yl1du[c]);
  2447. }
  2448.  
  2449. CHAR
  2450. #ifdef CK_ANSIC
  2451. xdul1(CHAR c) 
  2452. #else
  2453. xdul1(c) CHAR c; 
  2454. #endif /* CK_ANSIC */
  2455. { /* xdul1 */            /* Dutch ISO 646 to Latin-1 */
  2456.     return(ydul1[c]);
  2457. }
  2458.  
  2459. CHAR
  2460. #ifdef CK_ANSIC
  2461. xfil1(CHAR c) 
  2462. #else
  2463. xfil1(c) CHAR c; 
  2464. #endif /* CK_ANSIC */
  2465. { /* xfil1 */            /* Finnish ISO 646 to Latin-1 */
  2466.     return(yfil1[c]); 
  2467. }
  2468.  
  2469. CHAR
  2470. #ifdef CK_ANSIC
  2471. xl1fi(CHAR c) 
  2472. #else
  2473. xl1fi(c) CHAR c; 
  2474. #endif /* CK_ANSIC */
  2475. { /* xl1fi */            /* Latin-1 to Finnish ISO 646 */
  2476.     return(yl1fi[c]); 
  2477. }
  2478.  
  2479. CHAR
  2480. #ifdef CK_ANSIC
  2481. xfcl1(CHAR c) 
  2482. #else
  2483. xfcl1(c) CHAR c; 
  2484. #endif /* CK_ANSIC */
  2485. { /* xfcl1 */            /* French Canadian ISO646 to Latin-1 */
  2486.     return(yfcl1[c]); 
  2487. }
  2488.  
  2489. CHAR
  2490. #ifdef CK_ANSIC
  2491. xl1fc(CHAR c) 
  2492. #else
  2493. xl1fc(c) CHAR c; 
  2494. #endif /* CK_ANSIC */
  2495. { /* xl1fc */            /* Latin-1 to French Canadian ISO646 */
  2496.     return(yl1fc[c]); 
  2497. }
  2498.  
  2499. CHAR
  2500. #ifdef CK_ANSIC
  2501. xitl1(CHAR c) 
  2502. #else
  2503. xitl1(c) CHAR c; 
  2504. #endif /* CK_ANSIC */
  2505. { /* xitl1 */            /* Italian ISO 646 to Latin-1 */
  2506.     return(yitl1[c]); 
  2507. }
  2508.  
  2509. CHAR
  2510. #ifdef CK_ANSIC
  2511. xl1it(CHAR c) 
  2512. #else
  2513. xl1it(c) CHAR c; 
  2514. #endif /* CK_ANSIC */
  2515. { /* xl1it */            /* Latin-1 to Italian ISO 646 */
  2516.     return(yl1it[c]); 
  2517. }
  2518.  
  2519. CHAR
  2520. #ifdef CK_ANSIC
  2521. xnel1(CHAR c) 
  2522. #else
  2523. xnel1(c) CHAR c; 
  2524. #endif /* CK_ANSIC */
  2525. { /* xnel1 */         /* NeXT to Latin-1 */
  2526.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2527.     if (c == 234) {            /* handle OE digraph. */
  2528.         zmstuff('E');
  2529.         return('O');
  2530.     } else if (c == 250) {        /* Also lowercase oe. */
  2531.         zmstuff('e');
  2532.         return('o');
  2533.     }
  2534.     }
  2535.     return(ynel1[c]);
  2536. }
  2537.  
  2538. CHAR
  2539. #ifdef CK_ANSIC
  2540. xl1ne(CHAR c) 
  2541. #else
  2542. xl1ne(c) CHAR c; 
  2543. #endif /* CK_ANSIC */
  2544. { /* xl1ne */         /* Latin-1 to NeXT */
  2545.     return(yl1ne[c]);
  2546. }
  2547.  
  2548. CHAR
  2549. #ifdef CK_ANSIC
  2550. xnol1(CHAR c) 
  2551. #else
  2552. xnol1(c) CHAR c; 
  2553. #endif /* CK_ANSIC */
  2554. { /* xnol1 */         /* Norwegian and Danish ISO 646 to Latin-1 */
  2555.     return(ynol1[c]); 
  2556. }
  2557.  
  2558. CHAR
  2559. #ifdef CK_ANSIC
  2560. xl1no(CHAR c) 
  2561. #else
  2562. xl1no(c) CHAR c; 
  2563. #endif /* CK_ANSIC */
  2564. { /* xl1no */         /* Latin-1 to Norwegian and Danish ISO 646 */
  2565.     return(yl1no[c]); 
  2566. }
  2567.  
  2568. CHAR
  2569. #ifdef CK_ANSIC
  2570. xpol1(CHAR c) 
  2571. #else
  2572. xpol1(c) CHAR c; 
  2573. #endif /* CK_ANSIC */
  2574. { /* xpol1 */            /* Portuguese ISO 646 to Latin-1 */
  2575.     return(ypol1[c]); 
  2576. }
  2577.  
  2578. CHAR
  2579. #ifdef CK_ANSIC
  2580. xl1po(CHAR c) 
  2581. #else
  2582. xl1po(c) CHAR c; 
  2583. #endif /* CK_ANSIC */
  2584. { /* xl1po */            /* Latin-1 to Portuguese ISO 646 */
  2585.     return(yl1po[c]); 
  2586. }
  2587.  
  2588. CHAR
  2589. #ifdef CK_ANSIC
  2590. xspl1(CHAR c) 
  2591. #else
  2592. xspl1(c) CHAR c; 
  2593. #endif /* CK_ANSIC */
  2594. { /* xspl1 */            /* Spanish ISO 646 to Latin-1 */
  2595.     return(yspl1[c]); 
  2596. }
  2597.  
  2598. CHAR
  2599. #ifdef CK_ANSIC
  2600. xl1sp(CHAR c) 
  2601. #else
  2602. xl1sp(c) CHAR c; 
  2603. #endif /* CK_ANSIC */
  2604. { /* xl1sp */            /* Latin-1 to Spanish ISO 646 */
  2605.     return(yl1sp[c]); 
  2606. }
  2607.  
  2608. CHAR
  2609. #ifdef CK_ANSIC
  2610. xswl1(CHAR c) 
  2611. #else
  2612. xswl1(c) CHAR c; 
  2613. #endif /* CK_ANSIC */
  2614. { /* xswl1 */            /* Swedish ISO 646 to Latin-1 */
  2615.     return(yswl1[c]); 
  2616. }
  2617.  
  2618. CHAR
  2619. #ifdef CK_ANSIC
  2620. xl1sw(CHAR c) 
  2621. #else
  2622. xl1sw(c) CHAR c; 
  2623. #endif /* CK_ANSIC */
  2624. { /* xl1sw */            /* Latin-1 to Swedish ISO 646 */
  2625.     return(yl1sw[c]); 
  2626. }
  2627.  
  2628. CHAR
  2629. #ifdef CK_ANSIC
  2630. xchl1(CHAR c) 
  2631. #else
  2632. xchl1(c) CHAR c; 
  2633. #endif /* CK_ANSIC */
  2634. { /* xchl1 */            /* Swiss ISO 646 to Latin-1 */
  2635.     return(ychl1[c]); 
  2636. }
  2637.  
  2638. CHAR
  2639. #ifdef CK_ANSIC
  2640. xl1ch(CHAR c) 
  2641. #else
  2642. xl1ch(c) CHAR c; 
  2643. #endif /* CK_ANSIC */
  2644. { /* xl1ch */            /* Latin-1 to Swiss ISO 646 */
  2645.     return(yl1ch[c]); 
  2646. }
  2647.  
  2648. CHAR
  2649. #ifdef CK_ANSIC
  2650. xhul1(CHAR c) 
  2651. #else
  2652. xhul1(c) CHAR c; 
  2653. #endif /* CK_ANSIC */
  2654. { /* xhul1 */            /* Hungarian ISO 646 to Latin-1 */
  2655.     return(yhul1[c]);
  2656. }
  2657.  
  2658. CHAR
  2659. #ifdef CK_ANSIC
  2660. xl1hu(CHAR c) 
  2661. #else
  2662. xl1hu(c) CHAR c; 
  2663. #endif /* CK_ANSIC */
  2664. { /* xl1hu */            /* Latin-1 to Hungarian ISO 646 */
  2665.     return(yl1hu[c]);
  2666. }
  2667.  
  2668. CHAR
  2669. #ifdef CK_ANSIC
  2670. xl1dm(CHAR c) 
  2671. #else
  2672. xl1dm(c) CHAR c; 
  2673. #endif /* CK_ANSIC */
  2674. { /* xl1dm */ /* Latin-1 to DEC Multinational Character Set (MCS) */
  2675.     return(yl1dm[c]); 
  2676. }
  2677.  
  2678. CHAR
  2679. #ifdef CK_ANSIC
  2680. xl1dg(CHAR c) 
  2681. #else
  2682. xl1dg(c) CHAR c; 
  2683. #endif /* CK_ANSIC */
  2684. { /* xl1dg */ /* Latin-1 to DG International Character Set (MCS) */
  2685.     return(yl1dg[c]); 
  2686. }
  2687.  
  2688. CHAR
  2689. #ifdef CK_ANSIC
  2690. xdml1(CHAR c) 
  2691. #else
  2692. xdml1(c) CHAR c; 
  2693. #endif /* CK_ANSIC */
  2694. { /* xdml1 */ /* DEC Multinational Character Set (MCS) to Latin-1 */
  2695.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2696.     if (c == 215) {            /* handle OE digraph. */
  2697.         zmstuff('E');
  2698.         return('O');
  2699.     } else if (c == 247) {        /* Also lowercase oe. */
  2700.         zmstuff('e');
  2701.         return('o');
  2702.     }
  2703.     }
  2704.     return(ydml1[c]); 
  2705. }
  2706.  
  2707. CHAR
  2708. #ifdef CK_ANSIC
  2709. xdgl1(CHAR c) 
  2710. #else
  2711. xdgl1(c) CHAR c; 
  2712. #endif /* CK_ANSIC */
  2713. { /* xdgl1 */ /* DG International Character Set (MCS) to Latin-1 */
  2714.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2715.     if (c == 215) {            /* handle OE digraph. */
  2716.         zmstuff('E');
  2717.         return('O');
  2718.     } else if (c == 247) {        /* Also lowercase oe. */
  2719.         zmstuff('e');
  2720.         return('o');
  2721.     }
  2722.     }
  2723.     return(ydgl1[c]); 
  2724. }
  2725.  
  2726. CHAR
  2727. #ifdef CK_ANSIC
  2728. xr8l1(CHAR c) 
  2729. #else
  2730. xr8l1(c) CHAR c; 
  2731. #endif /* CK_ANSIC */
  2732. { /* xr8l1 */ /* Hewlett Packard Roman8 to Latin-1 */
  2733.     return(yr8l1[c]); 
  2734. }
  2735.  
  2736. CHAR
  2737. #ifdef CK_ANSIC
  2738. xl1r8(CHAR c) 
  2739. #else
  2740. xl1r8(c) CHAR c; 
  2741. #endif /* CK_ANSIC */
  2742. { /* xl1r8 */ /* Latin-1 to Hewlett Packard Roman8 Character Set */
  2743.     return(yl1r8[c]); 
  2744. }
  2745.  
  2746.  
  2747. /* Translation functions for receiving files and translating them into ASCII */
  2748.  
  2749. CHAR
  2750. #ifdef CK_ANSIC
  2751. zl1as(CHAR c) 
  2752. #else
  2753. zl1as(c) CHAR c; 
  2754. #endif /* CK_ANSIC */
  2755. { /* zl1as */
  2756.     switch(langs[language].id) {
  2757.  
  2758.       case L_DUTCH:
  2759.     if (c == 255) {            /* Dutch umlaut-y */
  2760.         zdstuff('j');        /* becomes ij */
  2761.         return('i');
  2762.     } else return(yl1as[c]);    /* all others by the book */
  2763.  
  2764.       case L_GERMAN:
  2765.     switch (c) {            /* German, special rules. */
  2766.       case 196:            /* umlaut-A -> Ae */
  2767.         zdstuff('e');
  2768.         return('A');
  2769.       case 214:            /* umlaut-O -> Oe */
  2770.         zdstuff('e');
  2771.         return('O');
  2772.       case 220:            /* umlaut-U -> Ue */
  2773.         zdstuff('e');
  2774.         return('U');
  2775.       case 228:            /* umlaut-a -> ae */
  2776.         zdstuff('e');
  2777.         return('a');
  2778.       case 246:            /* umlaut-o -> oe */
  2779.         zdstuff('e');
  2780.         return('o');
  2781.       case 252:            /* umlaut-u -> ue */
  2782.         zdstuff('e');
  2783.         return('u');
  2784.       case 223:            /* ess-zet -> ss */
  2785.         zdstuff('s');
  2786.         return('s');
  2787.       default: return(yl1as[c]);    /* all others by the book */
  2788.     }
  2789.       case L_DANISH:
  2790.       case L_FINNISH:
  2791.       case L_NORWEGIAN:
  2792.       case L_SWEDISH:
  2793.     switch (c) {            /* Scandanavian languages. */
  2794.       case 196:            /* umlaut-A -> Ae */
  2795.         zdstuff('e');
  2796.         return('A');
  2797.       case 214:            /* umlaut-O -> Oe */
  2798.       case 216:            /* O-slash -> Oe */
  2799.         zdstuff('e');
  2800.         return('O');
  2801.       case 220:            /* umlaut-U -> Y */
  2802.         /* return('Y'); */
  2803.         zdstuff('e');
  2804.         return('U');
  2805.       case 228:            /* umlaut-a -> ae */
  2806.         zdstuff('e');
  2807.         return('a');
  2808.       case 246:            /* umlaut-o -> oe */
  2809.       case 248:            /* o-slash -> oe */
  2810.         zdstuff('e');
  2811.         return('o');
  2812.       case 252:            /* umlaut-u -> y */
  2813.         /* return('y'); */
  2814.         zdstuff('e');
  2815.         return('u');
  2816.       case 197:            /* A-ring -> Aa */
  2817.         zdstuff('a');
  2818.         return('A');
  2819.           case 229:            /* a-ring -> aa */
  2820.         zdstuff('a');
  2821.         return('a');
  2822.       default: return(yl1as[c]);    /* All others by the book */
  2823.     }
  2824.       default:
  2825.     return(yl1as[c]);        /* Not German, by the table. */
  2826.     }
  2827. }
  2828.  
  2829. CHAR                    /* IBM CP437 to Latin-1 */
  2830. #ifdef CK_ANSIC
  2831. x43l1(CHAR c) 
  2832. #else
  2833. x43l1(c) CHAR c; 
  2834. #endif /* CK_ANSIC */
  2835. { /* x43l1 */
  2836.     return(y43l1[c]);
  2837. }
  2838.  
  2839. CHAR                    /* IBM CP850 to Latin-1 */
  2840. #ifdef CK_ANSIC
  2841. x85l1(CHAR c) 
  2842. #else
  2843. x85l1(c) CHAR c; 
  2844. #endif /* CK_ANSIC */
  2845. { /* x85l1 */
  2846.     return(y85l1[c]);
  2847. }
  2848.  
  2849. CHAR                    /* Latin-1 to IBM CP437 */
  2850. #ifdef CK_ANSIC
  2851. xl143(CHAR c) 
  2852. #else
  2853. xl143(c) CHAR c; 
  2854. #endif /* CK_ANSIC */
  2855. { /* xl143 */
  2856.     return(yl143[c]);
  2857. }
  2858.  
  2859. CHAR                    /* Latin-1 to CP850 */
  2860. #ifdef CK_ANSIC
  2861. xl185(CHAR c) 
  2862. #else
  2863. xl185(c) CHAR c; 
  2864. #endif /* CK_ANSIC */
  2865. { /* xl185 */
  2866.     return(yl185[c]);
  2867. }
  2868.  
  2869. CHAR
  2870. #ifdef CK_ANSIC
  2871. x43as(CHAR c) 
  2872. #else
  2873. x43as(c) CHAR c; 
  2874. #endif /* CK_ANSIC */
  2875. { /* x43as */                /* CP437 to ASCII */
  2876.     c = y43l1[c];            /* Translate to Latin-1 */
  2877.     return(xl143(c));            /* and from Latin-1 to ASCII. */
  2878. }
  2879.  
  2880. CHAR
  2881. #ifdef CK_ANSIC
  2882. x85as(CHAR c) 
  2883. #else
  2884. x85as(c) CHAR c; 
  2885. #endif /* CK_ANSIC */
  2886. { /* x85as */                /* CP850 to ASCII */
  2887.     c = y85l1[c];            /* Translate to Latin-1 */
  2888.     return(xl1as(c));            /* and from Latin-1 to ASCII. */
  2889. }
  2890.  
  2891. CHAR                    /* Macintosh Latin to Latin-1 */
  2892. #ifdef CK_ANSIC
  2893. xaql1(CHAR c) 
  2894. #else
  2895. xaql1(c) CHAR c; 
  2896. #endif /* CK_ANSIC */
  2897. { /* xaql1 */
  2898.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2899.     if (c == 206) {            /* handle OE digraph. */
  2900.         zmstuff('E');
  2901.         return('O');
  2902.     } else if (c == 207) {        /* Also lowercase oe. */
  2903.         zmstuff('e');
  2904.         return('o');
  2905.     }
  2906.     }
  2907.     return(yaql1[c]);
  2908. }
  2909.  
  2910. CHAR                    /* Macintosh Latin to ASCII */
  2911. #ifdef CK_ANSIC
  2912. xaqas(CHAR c) 
  2913. #else
  2914. xaqas(c) CHAR c; 
  2915. #endif /* CK_ANSIC */
  2916. { /* xaqas */
  2917.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2918.     if (c == 206) {            /* handle OE digraph. */
  2919.         zmstuff('E');
  2920.         return('O');
  2921.     } else if (c == 207) {        /* Also lowercase oe. */
  2922.         zmstuff('e');
  2923.         return('o');
  2924.     }
  2925.     }
  2926.     c = yaql1[c];            /* Translate to Latin-1 */
  2927.     return(xl1as(c));            /* then to ASCII. */
  2928. }
  2929.  
  2930. CHAR                    /* Latin-1 to Macintosh Latin */
  2931. #ifdef CK_ANSIC
  2932. xl1aq(CHAR c) 
  2933. #else
  2934. xl1aq(c) CHAR c; 
  2935. #endif /* CK_ANSIC */
  2936. { /* xl1aq */
  2937.     return(yl1aq[c]);
  2938. }
  2939.  
  2940. #ifdef LATIN2
  2941.  
  2942. /* Translation functions for Latin Alphabet 2 */
  2943.  
  2944. CHAR                    /* Latin-2 to Latin-1 */
  2945. #ifdef CK_ANSIC
  2946. xl2l1(CHAR c) 
  2947. #else
  2948. xl2l1(c) CHAR c; 
  2949. #endif /* CK_ANSIC */
  2950. { /* xll2l1 */
  2951.     return(yl2l1[c]);
  2952. }
  2953.  
  2954. CHAR                    /* Latin-1 to Latin-2 */
  2955. #ifdef CK_ANSIC
  2956. xl1l2(CHAR c) 
  2957. #else
  2958. xl1l2(c) CHAR c; 
  2959. #endif /* CK_ANSIC */
  2960. { /* xll1l2 */
  2961.     return(yl1l2[c]);
  2962. }
  2963.  
  2964. CHAR                    /* Latin-2 to ASCII */
  2965. #ifdef CK_ANSIC
  2966. xl2as(CHAR c) 
  2967. #else
  2968. xl2as(c) CHAR c; 
  2969. #endif /* CK_ANSIC */
  2970. { /* xll2as */
  2971.     return(yl2as[c]);
  2972. }
  2973.  
  2974. CHAR                    /* Latin-2 to CP852 */
  2975. #ifdef CK_ANSIC
  2976. xl252(CHAR c) 
  2977. #else
  2978. xl252(c) CHAR c; 
  2979. #endif /* CK_ANSIC */
  2980. { /* xll252 */
  2981.     return(yl252[c]);
  2982. }
  2983.  
  2984. CHAR                    /* CP852 to Latin-2 */
  2985. #ifdef CK_ANSIC
  2986. x52l2(CHAR c) 
  2987. #else
  2988. x52l2(c) CHAR c; 
  2989. #endif /* CK_ANSIC */
  2990. { /* x52l2 */
  2991.     return(y52l2[c]);
  2992. }
  2993.  
  2994. CHAR                    /* CP852 to ASCII */
  2995. #ifdef CK_ANSIC
  2996. x52as(CHAR c) 
  2997. #else
  2998. x52as(c) CHAR c; 
  2999. #endif /* CK_ANSIC */
  3000. { /* xl52as */
  3001.     return(yl2as[y52l2[c]]);        /* CP852 -> Latin-2 -> ASCII */
  3002. }
  3003.  
  3004. CHAR                    /* CP852 to Latin-1 */
  3005. #ifdef CK_ANSIC
  3006. x52l1(CHAR c) 
  3007. #else
  3008. x52l1(c) CHAR c; 
  3009. #endif /* CK_ANSIC */
  3010. { /* xl52l1 */
  3011.     return(yl2l1[y52l2[c]]);        /* CP852 -> Latin-2 -> Latin-1 */
  3012. }
  3013.  
  3014. CHAR                    /* Latin-1 to CP852 */
  3015. #ifdef CK_ANSIC
  3016. xl152(CHAR c) 
  3017. #else
  3018. xl152(c) CHAR c; 
  3019. #endif /* CK_ANSIC */
  3020. { /* xll152 */
  3021.     return(yl252[yl1l2[c]]);        /* Latin-1 -> Latin-2 -> CP852 */
  3022. }
  3023.  
  3024. CHAR                    /* Latin-2 to NeXT */
  3025. #ifdef CK_ANSIC
  3026. xl2ne(CHAR c) 
  3027. #else
  3028. xl2ne(c) CHAR c; 
  3029. #endif /* CK_ANSIC */
  3030. { /* xll2ne */
  3031.     switch(c) {
  3032.       case 162: return(198);        /* Breve */
  3033.       case 163: return(232);        /* L with stroke */
  3034.       case 178: return(206);        /* Ogonek */
  3035.       case 179: return(248);        /* l with stroke */
  3036.       case 183: return(207);        /* Caron */
  3037.       case 189: return(205);        /* Double acute */
  3038.       case 208: return(144);        /* D stroke = Eth */
  3039.       case 240: return(230);        /* d stroke = eth */
  3040.       case 255: return(199);        /* Dot above */
  3041.       default:  return(yl1ne[yl2l1[c]]);
  3042.     }
  3043. }
  3044.  
  3045. CHAR                    /* Latin-2 to CP437 */
  3046. #ifdef CK_ANSIC
  3047. xl243(CHAR c) 
  3048. #else
  3049. xl243(c) CHAR c; 
  3050. #endif /* CK_ANSIC */
  3051. { /* xll243 */
  3052.     return(yl1l2[y43l1[c]]);
  3053. }
  3054.  
  3055. CHAR                    /* Latin-2 to CP850 */
  3056. #ifdef CK_ANSIC
  3057. xl285(CHAR c) 
  3058. #else
  3059. xl285(c) CHAR c; 
  3060. #endif /* CK_ANSIC */
  3061. { /* xll285 */
  3062.     return(yl1l2[y85l1[c]]);
  3063. }
  3064.  
  3065. CHAR                    /* Latin-2 to Apple */
  3066. #ifdef CK_ANSIC
  3067. xl2aq(CHAR c) 
  3068. #else
  3069. xl2aq(c) CHAR c; 
  3070. #endif /* CK_ANSIC */
  3071. { /* xl2aq */
  3072.     return(yl1aq[yl2l1[c]]);        /* Could do more... */
  3073. }
  3074.  
  3075. CHAR                    /* Latin-2 to DGI */
  3076. #ifdef CK_ANSIC
  3077. xl2dg(CHAR c) 
  3078. #else
  3079. xl2dg(c) CHAR c; 
  3080. #endif /* CK_ANSIC */
  3081. { /* xll2dg */
  3082.     return(ydgl1[yl1l2[c]]);
  3083. }
  3084.  
  3085. CHAR                    /* Latin-2 to Short KOI */
  3086. #ifdef CK_ANSIC
  3087. xl2sk(CHAR c) 
  3088. #else
  3089. xl2sk(c) CHAR c; 
  3090. #endif /* CK_ANSIC */
  3091. { /* xll2sk */
  3092.     return(islower(c) ? toupper(c) : c);
  3093. }
  3094.  
  3095. CHAR                    /* NeXT to Latin-2 */
  3096. #ifdef CK_ANSIC
  3097. xnel2(CHAR c) 
  3098. #else
  3099. xnel2(c) CHAR c; 
  3100. #endif /* CK_ANSIC */
  3101. { /* xnel2 */
  3102.     switch (c) {
  3103.       case 144: return(208);        /* D stroke = Eth */
  3104.       case 198: return(162);        /* Breve */
  3105.       case 199: return(255);        /* Dot above */
  3106.       case 205: return(189);        /* Double acute */
  3107.       case 206: return(178);        /* Ogonek */
  3108.       case 207: return(183);        /* Caron */
  3109.       case 230: return(240);        /* d stroke = eth */
  3110.       case 232: return(163);        /* L with stroke */
  3111.       case 248: return(179);        /* l with stroke */
  3112.       default:  return(yl1l2[ynel1[c]]); /* Others, go thru Latin-1 */
  3113.     }
  3114. }
  3115.  
  3116. CHAR                    /* CP437 to Latin-2 */
  3117. #ifdef CK_ANSIC
  3118. x43l2(CHAR c) 
  3119. #else
  3120. x43l2(c) CHAR c; 
  3121. #endif /* CK_ANSIC */
  3122. { /* xl43l2 */
  3123.     return(yl1l2[y43l1[c]]);
  3124. }
  3125.  
  3126. CHAR                    /* CP850 to Latin-2 */
  3127. #ifdef CK_ANSIC
  3128. x85l2(CHAR c) 
  3129. #else
  3130. x85l2(c) CHAR c; 
  3131. #endif /* CK_ANSIC */
  3132. { /* xl85l2 */
  3133.     return(yl1l2[y85l1[c]]);
  3134. }
  3135.  
  3136. CHAR                    /* Apple to Latin-2 */
  3137. #ifdef CK_ANSIC
  3138. xaql2(CHAR c) 
  3139. #else
  3140. xaql2(c) CHAR c; 
  3141. #endif /* CK_ANSIC */
  3142. { /* xlaql2 */
  3143.     switch (c) {
  3144.       case 249: return(162);        /* Breve accent */
  3145.       case 250: return(255);        /* Dot accent */
  3146.       case 253: return(189);        /* Double acute */
  3147.       default: return(yl1l2[yaql1[c]]);
  3148.     }
  3149. }
  3150.  
  3151. CHAR                    /* DGI to Latin-2 */
  3152. #ifdef CK_ANSIC
  3153. xdgl2(CHAR c) 
  3154. #else
  3155. xdgl2(c) CHAR c; 
  3156. #endif /* CK_ANSIC */
  3157. { /* xldgl2 */
  3158.     return(yl1l2[ydgl1[c]]);        /* (for now) */
  3159. }
  3160.  
  3161. CHAR                    /* Short KOI to Latin-2 */
  3162. #ifdef CK_ANSIC
  3163. xskl2(CHAR c) 
  3164. #else
  3165. xskl2(c) CHAR c; 
  3166. #endif /* CK_ANSIC */
  3167. { /* xlskl2 */
  3168.     return(islower(c) ? toupper(c) : c);
  3169. }
  3170.  
  3171. CHAR                    /* Latin-2 to German */
  3172. #ifdef CK_ANSIC
  3173. xl2ge(CHAR c) 
  3174. #else
  3175. xl2ge(c) CHAR c; 
  3176. #endif /* CK_ANSIC */
  3177. { /* xll2ge */
  3178.     switch(c) {
  3179.       case 167: return(64);        /* Paragraph sign */
  3180.       case 196: return(91);        /* A-diaeresis */
  3181.       case 214: return(92);        /* O-diaeresis */
  3182.       case 220: return(93);        /* U-diaeresis */
  3183.       case 223: return(126);        /* double-s */
  3184.       case 228: return(123);        /* a-diaeresis */
  3185.       case 246: return(124);        /* o-diaeresis */
  3186.       case 252: return(125);        /* u-diaeresis */
  3187.       default:  return(yl2as[c]);    /* Others */
  3188.     }
  3189. }
  3190.  
  3191. CHAR                    /* German to Latin-2 */
  3192. #ifdef CK_ANSIC
  3193. xgel2(CHAR c) 
  3194. #else
  3195. xgel2(c) CHAR c; 
  3196. #endif /* CK_ANSIC */
  3197. { /* xlgel2 */
  3198.     switch(c) {
  3199.       case 64:  return(167);        /* Paragraph sign */
  3200.       case 91:  return(196);        /* A-diaeresis */
  3201.       case 92:  return(214);        /* O-diaeresis */
  3202.       case 93:  return(220);        /* U-diaeresis */
  3203.       case 123: return(228);        /* a-diaeresis */
  3204.       case 126: return(223);        /* double-s */
  3205.       case 124: return(246);        /* o-diaeresis */
  3206.       case 125: return(252);        /* u-diaeresis */
  3207.       default:  return(c);        /* Others */
  3208.     }
  3209. }
  3210.  
  3211. CHAR                    /* Latin-2 to Hungarian */
  3212. #ifdef CK_ANSIC
  3213. xl2hu(CHAR c) 
  3214. #else
  3215. xl2hu(c) CHAR c; 
  3216. #endif /* CK_ANSIC */
  3217. { /* xll2hu */
  3218.     switch(c) {
  3219.       case 164: return(36);        /* Currency symbol */
  3220.       case 189: return(126);        /* Double acute accent */
  3221.       case 193: return(64);        /* A-acute */
  3222.       case 201: return(91);        /* E-acute */
  3223.       case 214: return(92);        /* O-diaeresis */
  3224.       case 220: return(93);        /* U-diaeresis */
  3225.       case 225: return(96);        /* a-acute */
  3226.       case 233: return(123);        /* e-acute */
  3227.       case 246: return(124);        /* o-diaeresis */
  3228.       case 252: return(125);        /* u-diaeresis */
  3229.       default:  return(yl2as[c]);    /* Others */
  3230.     }
  3231. }
  3232.  
  3233. CHAR                    /* Hungarian to Latin-2 */
  3234. #ifdef CK_ANSIC
  3235. xhul2(CHAR c) 
  3236. #else
  3237. xhul2(c) CHAR c; 
  3238. #endif /* CK_ANSIC */
  3239. { /* xlhul2 */
  3240.     switch(c) {
  3241.       case 36:  return(164);        /* Currency symbol */
  3242.       case 64:  return(193);        /* A-acute */
  3243.       case 91:  return(201);        /* E-acute */
  3244.       case 92:  return(214);        /* O-diaeresis */
  3245.       case 93:  return(220);        /* U-diaeresis */
  3246.       case 96:  return(225);        /* a-acute */
  3247.       case 123: return(233);        /* e-acute */
  3248.       case 124: return(246);        /* o-diaeresis */
  3249.       case 125: return(252);        /* u-diaeresis */
  3250.       case 126: return(189);        /* Double acute accent */
  3251.       default:  return(c);        /* Others */
  3252.     }
  3253. }
  3254.  
  3255. CHAR
  3256. #ifdef CK_ANSIC
  3257. xr8l2(CHAR c) 
  3258. #else
  3259. xr8l2(c) CHAR c; 
  3260. #endif /* CK_ANSIC */
  3261. { /* xr8l2 */ /* Hewlett Packard Roman8 to Latin-2 */
  3262.     switch (c) {
  3263.       case 235: return(169);        /* S caron */
  3264.       case 236: return(185);        /* s caron */
  3265.       default:  return(yl1l2[yr8l1[c]]);
  3266.     }
  3267. }
  3268.  
  3269. CHAR
  3270. #ifdef CK_ANSIC
  3271. xl2r8(CHAR c) 
  3272. #else
  3273. xl2r8(c) CHAR c; 
  3274. #endif /* CK_ANSIC */
  3275. { /* xl2r8 */ /* Latin-2 to Hewlett Packard Roman8 Character Set */
  3276.     switch (c) {
  3277.       case 169: return(235);        /* S caron */
  3278.       case 185: return(236);        /* s caron */
  3279.       default:  return(yr8l1[yl1l2[c]]);
  3280.     }
  3281. }
  3282.  
  3283. #else /* NOLATIN2 */
  3284.  
  3285. #define xl2l1 NULL
  3286. #define xl1l2 NULL
  3287. #define xl2as NULL
  3288. #define xl252 NULL
  3289. #define x52l2 NULL
  3290. #define x52as NULL
  3291. #define x52l1 NULL
  3292. #define xl152 NULL
  3293. #define xl2ne NULL
  3294. #define xl243 NULL
  3295. #define xl285 NULL
  3296. #define xl2aq NULL
  3297. #define xl2dg NULL
  3298. #define xl2sk NULL
  3299. #define xnel2 NULL
  3300. #define x43l2 NULL
  3301. #define x85l2 NULL
  3302. #define xaql2 NULL
  3303. #define xdgl2 NULL
  3304. #define xskl2 NULL
  3305. #define xl2ge NULL
  3306. #define xgel2 NULL
  3307. #define xl2hu NULL
  3308. #define xhul2 NULL
  3309. #define xl2r8 NULL
  3310. #define xr8l2 NULL
  3311. #endif /* LATIN2 */
  3312.  
  3313. #ifdef CYRILLIC
  3314. /* Translation functions for Cyrillic character sets */
  3315.  
  3316. CHAR                    /* Latin/Cyrillic to */
  3317. #ifdef CK_ANSIC
  3318. xlcac(CHAR c) 
  3319. #else
  3320. xlcac(c) CHAR c; 
  3321. #endif /* CK_ANSIC */
  3322. { /* xlcac */            /* Microsoft Code Page 866 */
  3323.     return(ylcac[c]);
  3324. }
  3325.  
  3326. CHAR                    /* Latin/Cyrillic to Old KOI-8 */
  3327. #ifdef CK_ANSIC
  3328. xlck8(CHAR c) 
  3329. #else
  3330. xlck8(c) CHAR c; 
  3331. #endif /* CK_ANSIC */
  3332. { /* xlck8 */
  3333.     return(ylck8[c]);
  3334. }
  3335.  
  3336. CHAR
  3337. #ifdef CK_ANSIC
  3338. xlcsk(CHAR c) 
  3339. #else
  3340. xlcsk(c) CHAR c; 
  3341. #endif /* CK_ANSIC */
  3342. { /* xlcsk */            /* Latin/Cyrillic to Short KOI */
  3343.     return(ylcsk[c]);
  3344. }
  3345.  
  3346. CHAR
  3347. #ifdef CK_ANSIC
  3348. xlcas(CHAR c) 
  3349. #else
  3350. xlcas(c) CHAR c; 
  3351. #endif /* CK_ANSIC */
  3352. { /* xlcas */            /* Latin/Cyrillic to ASCII */
  3353.     if (langs[language].id == L_RUSSIAN)
  3354.       return(ylcsk[c]);
  3355.     else
  3356.       return((c > 127) ? '?' : c);
  3357. }
  3358.  
  3359. CHAR                    /* CP866 */
  3360. #ifdef CK_ANSIC
  3361. xaclc(CHAR c) 
  3362. #else
  3363. xaclc(c) CHAR c; 
  3364. #endif /* CK_ANSIC */
  3365. { /* xaclc */            /* to Latin/Cyrillic */
  3366.     return(yaclc[c]);
  3367. }
  3368.  
  3369. CHAR                    /* Old KOI-8 to Latin/Cyrillic */
  3370. #ifdef CK_ANSIC
  3371. xk8lc(CHAR c) 
  3372. #else
  3373. xk8lc(c) CHAR c; 
  3374. #endif /* CK_ANSIC */
  3375. { /* xk8lc */
  3376.     return(yk8lc[c]);
  3377. }
  3378.  
  3379. CHAR
  3380. #ifdef CK_ANSIC
  3381. xskcy(CHAR c) 
  3382. #else
  3383. xskcy(c) CHAR c; 
  3384. #endif /* CK_ANSIC */
  3385. { /* xskcy */            /* Short KOI to Latin/Cyrillic */
  3386.     return(yskcy[c & 0x7f]);
  3387. }
  3388.  
  3389. CHAR
  3390. #ifdef CK_ANSIC
  3391. xascy(CHAR c) 
  3392. #else
  3393. xascy(c) CHAR c; 
  3394. #endif /* CK_ANSIC */
  3395. { /* xascy */            /* ASCII to Latin/Cyrillic */
  3396.     if (langs[language].id == L_RUSSIAN) { /* If LANGUAGE == RUSSIAN  */
  3397.     return(yskcy[c & 0x7f]);    /* treat ASCII as Short KOI */
  3398.     } else return((c > 127) ? '?' : c);
  3399. }
  3400.  
  3401. CHAR
  3402. #ifdef CK_ANSIC
  3403. xacas(CHAR c) 
  3404. #else
  3405. xacas(c) CHAR c; 
  3406. #endif /* CK_ANSIC */
  3407. { /* xacas */            /* CP866 to ASCII */
  3408.     if (langs[language].id == L_RUSSIAN) {
  3409.     c = yaclc[c];            /* First to Latin/Cyrillic */
  3410.     return(ylcsk[c]);        /* Then to Short KOI */
  3411.     } else return((c > 127) ? '?' : c);
  3412. }
  3413.  
  3414. CHAR
  3415. #ifdef CK_ANSIC
  3416. xskas(CHAR c) 
  3417. #else
  3418. xskas(c) CHAR c; 
  3419. #endif /* CK_ANSIC */
  3420. { /* xskas */            /* Short KOI to ASCII */
  3421.     return((c > 95) ? '?' : c);
  3422. }
  3423.  
  3424. CHAR
  3425. #ifdef CK_ANSIC
  3426. xk8as(CHAR c) 
  3427. #else
  3428. xk8as(c) CHAR c; 
  3429. #endif /* CK_ANSIC */
  3430. { /* xk8as */            /* Old KOI-8 Cyrillic to ASCII */
  3431.     if (langs[language].id == L_RUSSIAN) {
  3432.     c = yk8lc[c];            /* First to Latin/Cyrillic */
  3433.     return(ylcsk[c]);        /* Then to Short KOI */
  3434.     } else return((c > 127) ? '?' : c);
  3435. }
  3436.  
  3437. CHAR
  3438. #ifdef CK_ANSIC
  3439. xassk(CHAR c) 
  3440. #else
  3441. xassk(c) CHAR c; 
  3442. #endif /* CK_ANSIC */
  3443. { /* xassk */            /* ASCII to Short KOI */
  3444.     c &= 0x77;                /* Force it to be ASCII */
  3445.     return((c > 95) ? (c - 32) : c);    /* Fold columns 6-7 to 4-5 */
  3446. }
  3447.  
  3448. CHAR
  3449. #ifdef CK_ANSIC
  3450. xl1sk(CHAR c) 
  3451. #else
  3452. xl1sk(c) CHAR c; 
  3453. #endif /* CK_ANSIC */
  3454. { /* xl1sk */            /* Latin-1 to Short KOI */
  3455.     c = zl1as(c);            /* Convert to ASCII */
  3456.     return(c = xassk(c));        /* Convert ASCII to Short KOI */
  3457. }
  3458.  
  3459. CHAR
  3460. #ifdef CK_ANSIC
  3461. xaslc(CHAR c) 
  3462. #else
  3463. xaslc(c) CHAR c; 
  3464. #endif /* CK_ANSIC */
  3465. { /* xaslc */            /* ASCII to Latin/Cyrillic */
  3466.     if (langs[language].id == L_RUSSIAN)
  3467.       return(yskcy[c & 0x7f]);
  3468.     else return(c & 0x7f);
  3469. }
  3470.  
  3471. CHAR
  3472. #ifdef CK_ANSIC
  3473. xasac(CHAR c) 
  3474. #else
  3475. xasac(c) CHAR c; 
  3476. #endif /* CK_ANSIC */
  3477. { /* xasac */            /* ASCII to CP866 */
  3478.     if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  3479.     c = xskcy(c);            /* Translate to Latin/Cyrillic */
  3480.     return(ylcac[c]);        /* Then to CP866 */
  3481.     } else return(c & 0x7f);
  3482. }
  3483.  
  3484. CHAR
  3485. #ifdef CK_ANSIC
  3486. xask8(CHAR c) 
  3487. #else
  3488. xask8(c) CHAR c; 
  3489. #endif /* CK_ANSIC */
  3490. { /* xask8 */            /* ASCII to KOI-8 */
  3491.     if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  3492.     c = xskcy(c);            /* Translate to Latin/Cyrillic */
  3493.     return(ylck8[c]);        /* Then to KOI-8 */
  3494.     } else return(c & 0x7f);
  3495. }
  3496. #else /* No Cyrillic */
  3497. #define xacas NULL
  3498. #define xaclc NULL
  3499. #define xasac NULL
  3500. #define xascy NULL
  3501. #define xask8 NULL
  3502. #define xaslc NULL
  3503. #define xassk NULL
  3504. #define xk8as NULL
  3505. #define xk8lc NULL
  3506. #define xl1sk NULL
  3507. #define xlcac NULL
  3508. #define xlcas NULL
  3509. #define xlck8 NULL
  3510. #define xlch7 NULL
  3511. #define xlcsk NULL
  3512. #define xskas NULL
  3513. #define xskcy NULL
  3514. #endif /* CYRILLIC */
  3515.  
  3516. /* Translation functions for Hebrew character sets */
  3517.  
  3518. #ifdef HEBREW
  3519.  
  3520. CHAR
  3521. #ifdef CK_ANSIC
  3522. xash7(CHAR c) 
  3523. #else
  3524. xash7(c) CHAR c; 
  3525. #endif /* CK_ANSIC */
  3526. { /* xash7 */            /* ASCII to Hebrew-7 */
  3527.     if (c == 96) return('?');
  3528.     if (c > 96 && c < 123) return(c - 32);
  3529.     else return(c);
  3530. }
  3531.  
  3532. CHAR
  3533. #ifdef CK_ANSIC
  3534. xl1h7(CHAR c) 
  3535. #else
  3536. xl1h7(c) CHAR c; 
  3537. #endif /* CK_ANSIC */
  3538. { /* xl1h7 */            /* Latin-1 to Hebrew-7 */
  3539.     return(xash7(xl1as(c)));
  3540. }
  3541.  
  3542. CHAR
  3543. #ifdef CK_ANSIC
  3544. xl1lh(CHAR c) 
  3545. #else
  3546. xl1lh(c) CHAR c; 
  3547. #endif /* CK_ANSIC */
  3548. { /* xl1lh */            /* Latin-1 to Latin/Hebrew */
  3549.     switch(c) {
  3550.       case 170: return('a');        /* Feminine ordinal */
  3551.       case 186: return('o');        /* Masculine ordinal */
  3552.       case 215: return(170);        /* Times */
  3553.       case 247: return(186);        /* Divide */
  3554.       default:  return( (c > 190) ? xl1as(c) : c );
  3555.     }
  3556. }
  3557.  
  3558. CHAR
  3559. #ifdef CK_ANSIC
  3560. xl2h7(CHAR c) 
  3561. #else
  3562. xl2h7(c) CHAR c; 
  3563. #endif /* CK_ANSIC */
  3564. { /* xl2h7 */            /* Latin-2 to Hebrew-7 */
  3565.     return(xash7(xl2as(c)));
  3566. }
  3567.  
  3568. #ifndef NOCYRIL
  3569. CHAR
  3570. #ifdef CK_ANSIC
  3571. xlch7(CHAR c) 
  3572. #else
  3573. xlch7(c) CHAR c; 
  3574. #endif /* CK_ANSIC */
  3575. { /* xlch7 */            /* Latin/Cyrillic to Hebrew-7 */
  3576.     return(xash7(xlcas(c)));
  3577. }
  3578. #endif /* NOCYRIL */
  3579.  
  3580. CHAR
  3581. #ifdef CK_ANSIC
  3582. xlhas(CHAR c) 
  3583. #else
  3584. xlhas(c) CHAR c; 
  3585. #endif /* CK_ANSIC */
  3586. { /* xlhas */            /* Latin/Hebrew to ASCII */
  3587.     return( (c > 127) ? '?' : c );
  3588. }
  3589.  
  3590. CHAR
  3591. #ifdef CK_ANSIC
  3592. xlhl1(CHAR c) 
  3593. #else
  3594. xlhl1(c) CHAR c; 
  3595. #endif /* CK_ANSIC */
  3596. { /* xlhl1 */            /* Latin/Hebrew to Latin-1 */
  3597.     switch (c) {
  3598.       case 170: return(215);
  3599.       case 186: return(247);
  3600.       default: return( (c > 190) ? '?' : c );
  3601.     }
  3602. }
  3603.  
  3604. CHAR
  3605. #ifdef CK_ANSIC
  3606. xlh62(CHAR c) 
  3607. #else
  3608. xlh62(c) CHAR c; 
  3609. #endif /* CK_ANSIC */
  3610. { /* xlh62 */            /* Latin/Hebrew to CP862 */
  3611.     return(ylh62[c]);
  3612. }
  3613.  
  3614. CHAR
  3615. #ifdef CK_ANSIC
  3616. xl162(CHAR c) 
  3617. #else
  3618. xl162(c) CHAR c; 
  3619. #endif /* CK_ANSIC */
  3620. { /* xl162 */            /* Latin-1 to CP862 */
  3621.     return(xlh62(xl1lh(c)));    /* Via Latin/Hebrew */
  3622. }
  3623.  
  3624. CHAR
  3625. #ifdef CK_ANSIC
  3626. xlhh7(CHAR c) 
  3627. #else
  3628. xlhh7(c) CHAR c; 
  3629. #endif /* CK_ANSIC */
  3630. { /* xlhh7 */            /* Latin/Hebrew to Hebrew-7 */
  3631.     return(ylhh7[c]);
  3632. }
  3633.  
  3634. CHAR
  3635. #ifdef CK_ANSIC
  3636. xh7as(CHAR c) 
  3637. #else
  3638. xh7as(c) CHAR c; 
  3639. #endif /* CK_ANSIC */
  3640. { /* xh7as */            /* Hebrew-7 to ASCII */
  3641.     return( (c > 95 && c < 123) ? '?' : c );
  3642. }
  3643.  
  3644. CHAR
  3645. #ifdef CK_ANSIC
  3646. x62lh(CHAR c) 
  3647. #else
  3648. x62lh(c) CHAR c; 
  3649. #endif /* CK_ANSIC */
  3650. { /* x62lh */            /* CP862 to Latin/Hebrew */
  3651.     return(y62lh[c]);
  3652. }
  3653.  
  3654. CHAR
  3655. #ifdef CK_ANSIC
  3656. x62as(CHAR c) 
  3657. #else
  3658. x62as(c) CHAR c; 
  3659. #endif /* CK_ANSIC */
  3660. { /* x62as */            /* CP862 to ASCII */
  3661.     return( xlhas(x62lh(c)) );
  3662. }
  3663.  
  3664. CHAR
  3665. #ifdef CK_ANSIC
  3666. x62l1(CHAR c) 
  3667. #else
  3668. x62l1(c) CHAR c; 
  3669. #endif /* CK_ANSIC */
  3670. { /* x62l1 */            /* CP862 to Latin-1 */
  3671.     return( xlhl1(x62lh(c)) );
  3672. }
  3673.  
  3674. CHAR
  3675. #ifdef CK_ANSIC
  3676. xh7lh(CHAR c) 
  3677. #else
  3678. xh7lh(c) CHAR c; 
  3679. #endif /* CK_ANSIC */
  3680. { /* xh7lh */            /* Hebrew-7 to Latin/Hebrew */
  3681.     return(yh7lh[c]);
  3682. }
  3683.  
  3684. #else /* No Hebrew */
  3685.  
  3686. #define xash7 NULL
  3687. #define xl1h7 NULL
  3688. #define xl2h7 NULL
  3689. #define xlch7 NULL
  3690. #define xl1lh NULL
  3691. #define xlhas NULL
  3692. #define xlhl1 NULL
  3693. #define xl162 NULL
  3694. #define xlhh7 NULL
  3695. #define xlh62 NULL
  3696. #define xh7as NULL
  3697. #define x62as NULL
  3698. #define x62l1 NULL
  3699. #define xh7lh NULL
  3700. #define x62lh NULL
  3701.  
  3702. #endif /* HEBREW */
  3703.  
  3704. /* Translation functions for Japanese Kanji character sets */
  3705.  
  3706. #ifdef KANJI
  3707. /*
  3708.   Translate Kanji Transfer Character Set (EUC) to local file character set,
  3709.   contributed by Dr. Hirofumi Fujii, Japan High Energy Research Laboratory
  3710.   (KEK), Tokyo, Japan.
  3711.  
  3712.   a is a byte to be translated, which may be a single-byte character,
  3713.   the Katakana prefix, the first byte of a two-byte Kanji character, or the
  3714.   second byte of 2-byte Kanji character.
  3715.  
  3716.   fn is the output function.
  3717.  
  3718.   Returns 0 on success, -1 on failure.
  3719. */
  3720.  
  3721. _PROTOTYP(static int jpnxas, (int, int[]) );
  3722. _PROTOTYP(static int jpnxkt, (int, int[]) );
  3723. _PROTOTYP(static int jpnxkn, (int[], int[]) );
  3724.  
  3725. static int jpncnt;       /* byte count for Japanese */
  3726. static int jpnlst;       /* last status (for JIS7) */
  3727.  
  3728. static int
  3729. jpnxas(a, obuf) int a; int obuf[]; { /* Translate ASCII to local file code */
  3730.     int r;
  3731.  
  3732.     r = 0;
  3733.     if (fcharset == FC_JIS7) {
  3734.     switch (jpnlst) {
  3735.       case 1:
  3736.         obuf[0] = 0x0f;
  3737.         obuf[1] = a;
  3738.         r = 2;
  3739.         break;
  3740.       case 2:
  3741.         obuf[0] = 0x1b;
  3742.         obuf[1] = 0x28;
  3743.         obuf[2] = 0x4a;
  3744.         obuf[3] = a;
  3745.         r = 4;
  3746.         break;
  3747.       default:
  3748.         obuf[0] = a;
  3749.         r = 1;
  3750.         break;
  3751.     }
  3752.     } else {
  3753.     obuf[0] = a;
  3754.     r = 1;
  3755.     }
  3756.     return(r);
  3757. }
  3758.  
  3759. static int
  3760. jpnxkt(a, obuf) int a; int obuf[]; { 
  3761. /* Translate JIS X 201 Katakana to local code */
  3762.  
  3763.     int r;
  3764.   
  3765.     r = 0;
  3766.     if (fcharset == FC_JIS7) {
  3767.     switch (jpnlst) {
  3768.       case 2:                /* from Kanji */
  3769.         obuf[r++] = 0x1b;
  3770.         obuf[r++] = 0x28;
  3771.         obuf[r++] = 0x4a;
  3772.       case 0:                /* from Roman */
  3773.         obuf[r++] = 0x0e;
  3774.       default:
  3775.         obuf[r++] = (a & 0x7f);
  3776.       break;
  3777.     }
  3778.     } else {
  3779.     if (fcharset == FC_JEUC)
  3780.       obuf[r++] = 0x8e;
  3781.     obuf[r++] = (a | 0x80);
  3782.     }
  3783.     return(r);
  3784. }
  3785.  
  3786. static int
  3787. jpnxkn(ibuf, obuf) int ibuf[], obuf[]; {
  3788.     /* Translate JIS X 0208 Kanji to local code */
  3789.     int c1, c2;
  3790.     int r;
  3791.  
  3792.     c1 = ibuf[0] & 0x7f;
  3793.     c2 = ibuf[1] & 0x7f;
  3794.  
  3795.     if (fcharset == FC_SHJIS) {
  3796.     if (c1 & 1)
  3797.       c2 += 0x1f;
  3798.     else
  3799.       c2 += 0x7d;
  3800.  
  3801.         if (c2 >= 0x7f) c2++;
  3802.  
  3803.         c1 = ((c1 - 0x21) >> 1) + 0x81;
  3804.         if (c1 > 0x9f) c1 += 0x40;
  3805.  
  3806.         obuf[0] = c1;
  3807.         obuf[1] = c2;
  3808.         r = 2;
  3809.     } else if (fcharset == FC_JIS7) {
  3810.         r = 0;
  3811.         switch (jpnlst) {
  3812.         case 1:
  3813.         obuf[r++] = 0x0f; /* From Katakana */
  3814.         case 0:
  3815.         obuf[r++] = 0x1b;
  3816.         obuf[r++] = 0x24;
  3817.         obuf[r++] = 0x42;
  3818.       default:
  3819.         obuf[r++] = c1;
  3820.         obuf[r++] = c2;
  3821.         break;
  3822.     }
  3823.     } else {
  3824.         obuf[0] = (c1 | 0x80);
  3825.         obuf[1] = (c2 | 0x80);
  3826.         r = 2;
  3827.     }
  3828.     return(r);
  3829. }
  3830.  
  3831. int
  3832. xkanjf() {
  3833. /* Initialize parameters for xkanji */
  3834. /* This function should be called when F/X-packet is received */
  3835.     jpncnt = jpnlst = 0;
  3836.     return(0);
  3837. }
  3838.  
  3839. int
  3840. #ifdef CK_ANSIC
  3841. xkanjz( int (*fn)(char) )
  3842. #else
  3843. xkanjz( fn ) int (*fn)();
  3844. #endif /* CK_ANSIC */
  3845. { /* xkanjz */
  3846. /*
  3847.   Terminate xkanji
  3848.   This function must be called when Z-packet is received
  3849.   (before closing the file).
  3850. */
  3851.     static int obuf[6];
  3852.     int r, i, c;
  3853.   
  3854.     if (fcharset == FC_JIS7) {
  3855.         c = 'A';            /* Dummy Roman character */
  3856.         r = jpnxas(c, obuf) - 1;    /* -1 removes Dummy character */
  3857.         if (r > 0) {
  3858.         for (i = 0; i < r; i++)
  3859.           if ( ((*fn)((char) obuf[i])) < 0 )
  3860.         return( -1 );
  3861.     }
  3862.     }
  3863.     return( 0 );
  3864. }
  3865.  
  3866. int
  3867. #ifdef CK_ANSIC
  3868. xkanji(int a, int (*fn)(char))
  3869. #else
  3870. xkanji(a, fn) int a; int (*fn)();
  3871. #endif /* CK_ANSIC */
  3872. { /* xkanji */
  3873.     static int xbuf[2];
  3874.     static int obuf[8];
  3875.  
  3876.     int i, r;
  3877.     int c7;
  3878.     int state;
  3879.  
  3880.     r = 0;
  3881.     if (jpncnt == 0) {
  3882.     /* 1st byte */
  3883.     if ( (a & 0x80) == 0 ) {
  3884.         /* 8th bit is 0, i.e., single-byte code */
  3885.         r = jpnxas(a, obuf);
  3886.         state = 0;
  3887.     } else {
  3888.         /* 8th bit is 1, check the range */
  3889.         c7 = a & 0x7f;
  3890.         if ( ((c7 > 0x20) && (c7 < 0x7f)) || (c7 == 0x0e) ) {
  3891.             /* double byte code */
  3892.             xbuf[jpncnt++] = a;
  3893.         } else {
  3894.             /* single byte code */
  3895.             r = jpnxas(a, obuf);
  3896.             state = 0;
  3897.         }
  3898.     }
  3899.     } else {
  3900.     /* not the 1st byte */
  3901.     xbuf[jpncnt++] = a;
  3902.     if (xbuf[0] == 0x8e) {
  3903.         r = jpnxkt( xbuf[1], obuf );
  3904.         state = 1;
  3905.     } else {
  3906.         r = jpnxkn(xbuf, obuf);
  3907.         state = 2;
  3908.     }
  3909.     }
  3910.     if (r > 0) {
  3911.         for (i = 0; i < r; i++ )
  3912.       if ( ((*fn)((char) obuf[i])) < 0 )
  3913.         return( -1 );
  3914.         jpnlst = state;
  3915.         jpncnt = 0;
  3916.     }
  3917.     return( 0 );
  3918. }
  3919.  
  3920. /*
  3921.   Function for translating from Japanese file character set
  3922.   to Japanese EUC transfer character set.
  3923.   Returns a pointer to a string containing 0, 1, or 2 bytes.
  3924. */
  3925.  
  3926. /* zkanji */
  3927. static int jpnstz;            /* status for JIS-7 */
  3928. static int jpnpnd;            /* number of pending bytes */
  3929. static int jpnpnt;            /* pending buffer index */
  3930. static int jpnpbf[8];            /* pending buffer */
  3931.  
  3932. int
  3933. zkanjf() {                /* Initialize */
  3934.     jpnstz = jpnpnd = jpnpnt = 0;
  3935.     return(0);
  3936. }
  3937.  
  3938. int
  3939. zkanjz() {
  3940.     return( 0 );
  3941. }
  3942.  
  3943. int
  3944. #ifdef CK_ANSIC
  3945. zkanji( int (*fn)(void) )
  3946. #else
  3947. zkanji( fn ) int (*fn)();
  3948. #endif /* CK_ANSIC */
  3949. { /* zkanji */
  3950.     /* Read Japanese local code and translate to Japanese EUC */
  3951.     int a;
  3952.     int sc[3];
  3953.     
  3954.     /* No pending characters */
  3955.     if (fcharset == FC_SHJIS) {        /* Translating from Shift-JIS */
  3956.         if (jpnpnd) {
  3957.             jpnpnd--;
  3958.             return( jpnpbf[jpnpnt++] );
  3959.         }
  3960.         
  3961.         a = (*fn)();
  3962.     jpnpnd = jpnpnt = 0;
  3963.     if (((a >= 0x81) && (a <= 0x9f)) ||
  3964.         ((a >= 0xe0) && (a <= 0xfc))) { /* 2-byte Kanji code */
  3965.         sc[0] = a;
  3966.         if ((sc[1] = (*fn)()) < 0)    /* Get second byte */
  3967.           return( sc[1] );
  3968.         if (sc[0] <= 0x9f)
  3969.           sc[0] -= 0x71;
  3970.         else
  3971.           sc[0] -= 0xb1;
  3972.         sc[0] = sc[0] * 2 + 1;
  3973.         if (sc[1] > 0x7f)
  3974.           sc[1]--;
  3975.         if (sc[1] >= 0x9e) {
  3976.             sc[1] -= 0x7d;
  3977.             sc[0]++;
  3978.         } else {
  3979.             sc[1] -= 0x1f;
  3980.         }
  3981.         a = (sc[0] | 0x80);
  3982.         jpnpbf[0] = (sc[1] | 0x80);
  3983.         jpnpnd = 1;
  3984.         jpnpnt = 0;
  3985.     } else if ((a >= 0xa1) && (a <= 0xdf)) { /* Katakana */
  3986.         jpnpbf[0] = a;
  3987.         jpnpnd = 1;
  3988.         jpnpnt = 0;
  3989.         a = 0x8e;
  3990.     }
  3991.     return(a);
  3992.     } else if (fcharset == FC_JIS7 ) {    /* 7-bit JIS X 0208 */
  3993.         if (jpnpnd) {
  3994.             a = jpnpbf[jpnpnt++];
  3995.         jpnpnd--;
  3996.             return(a);
  3997.         }
  3998.         jpnpnt = 0;
  3999.         if ((a = (*fn)()) < 0)
  4000.       return(a);
  4001.         while (jpnpnd == 0) {
  4002.             if ((a > 0x20) && (a < 0x7f)) {
  4003.                 switch (jpnstz) {
  4004.           case 1:
  4005.             jpnpbf[jpnpnd++] = 0x80; /* Katakana */
  4006.             jpnpbf[jpnpnd++] = (a | 0x80);
  4007.             break;
  4008.           case 2:
  4009.             jpnpbf[jpnpnd++] = (a | 0x80); /* Kanji */
  4010.             if ((a = (*fn)()) < 0)
  4011.               return(a);
  4012.             jpnpbf[jpnpnd++] = (a | 0x80);
  4013.             break;
  4014.           default:
  4015.             jpnpbf[jpnpnd++] = a; /* Single byte */
  4016.             break;
  4017.                 }
  4018.             } else if (a == 0x0e) {
  4019.                 jpnstz = 1;
  4020.                 if ((a = (*fn)()) < 0)
  4021.           return(a);
  4022.             } else if (a == 0x0f) {
  4023.                 jpnstz = 0;
  4024.                 if ((a = (*fn)()) < 0)
  4025.           return(a);
  4026.             } else if (a == 0x1b) {
  4027.                 jpnpbf[jpnpnd++] = a;    /* Escape */
  4028.                 if ((a = (*fn)()) < 0)
  4029.           return(a);
  4030.                 jpnpbf[jpnpnd++] = a;
  4031.                 if (a == '$') {
  4032.                     if ((a = (*fn)()) < 0)
  4033.               return(a);
  4034.                     jpnpbf[jpnpnd++] = a;
  4035.                     if ((a == '@') || (a == 'B')) {
  4036.                         jpnstz = 2;
  4037.             jpnpnt = jpnpnd = 0;
  4038.                         if ((a = (*fn)()) < 0)
  4039.               return(a);
  4040.                     }
  4041.                 } else if (a == '(') {
  4042.                     if ((a = (*fn)()) < 0)
  4043.               return( a );
  4044.                     jpnpbf[jpnpnd++] = a;
  4045.                     if ((a == 'B') || (a == 'J')) {
  4046.                         jpnstz = 0;
  4047.             jpnpnt = jpnpnd = 0;
  4048.                         if ((a = (*fn)()) < 0)
  4049.               return(a);
  4050.                     }
  4051.                 } else if (a == 0x1b) {
  4052.                     jpnpnt = jpnpnd = 0;
  4053.                     if ((a = (*fn)()) < 0)
  4054.               return(a);
  4055.                 }
  4056.             } else {
  4057.                 jpnpbf[jpnpnd++] = a;
  4058.             }
  4059.         }
  4060.         jpnpnt = 0;
  4061.         a = jpnpbf[jpnpnt++];
  4062.     jpnpnd--;
  4063.         return(a);
  4064.     } else {
  4065.         a = (*fn)();
  4066.         return(a);
  4067.     }
  4068. }
  4069. #endif /* KANJI */
  4070.  
  4071. /*  TABLES OF TRANSLATION FUNCTIONS */
  4072.  
  4073. /*
  4074.   First, the table of translation functions for RECEIVING files.  That is,
  4075.   *from* the TRANSFER character set *to* the FILE character set, an array of
  4076.   pointers to functions.  The first index is the TRANSFER CHARACTER-SET
  4077.   number, the second index is the FILE CHARACTER-SET number.
  4078.  
  4079.   These arrays must be fully populated, even if (as is the case with Kanji
  4080.   character sets), all the entries are NULL.  Otherwise, subscript
  4081.   calculations will be wrong and we'll use the wrong functions.
  4082. */
  4083.  
  4084. #ifdef CK_ANSIC
  4085. CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])(CHAR) = 
  4086. #else
  4087. CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])() = 
  4088. #endif /* CK_ANSIC */
  4089. {
  4090.     NULL,            /* 0,0 transparent to us ascii */
  4091.     NULL,            /* 0,1 transparent to uk ascii */
  4092.     NULL,            /* 0,2 transparent to dutch nrc */
  4093.     NULL,            /* 0,3 transparent to finnish nrc */
  4094.     NULL,            /* 0,4 transparent to french nrc */
  4095.     NULL,            /* 0,5 transparent to fr-canadian nrc */
  4096.     NULL,            /* 0,6 transparent to german nrc */
  4097.     NULL,            /* 0,7 transparent to hungarian nrc */
  4098.     NULL,            /* 0,8 transparent to italian nrc */
  4099.     NULL,            /* 0,9 transparent to norge/danish nrc */
  4100.     NULL,            /* 0,10 transparent to portuguese nrc */
  4101.     NULL,            /* 0,11 transparent to spanish nrc */
  4102.     NULL,            /* 0,12 transparent to swedish nrc */
  4103.     NULL,            /* 0,13 transparent to swiss nrc */
  4104.     NULL,            /* 0,14 transparent to latin-1 */
  4105.     NULL,            /* 0,15 transparent to latin-2 */
  4106.     NULL,            /* 0,16 transparent to DEC MCS */
  4107.     NULL,            /* 0,17 transparent to NeXT */
  4108.     NULL,            /* 0,18 transparent to CP437 */
  4109.     NULL,            /* 0,19 transparent to CP850 */
  4110.     NULL,            /* 0,20 transparent to CP852 */
  4111.     NULL,            /* 0,21 transparent to Macintosh Latin */
  4112.     NULL,            /* 0,22 transparent to DGI */
  4113.     NULL,            /* 0,23 transparent to HP */
  4114.     NULL,            /* 0,24 transparent to Latin/Cyrillic */
  4115.     NULL,                       /* 0,25 transparent to CP866 */
  4116.     NULL,            /* 0,26 transparent to Short KOI-7 */
  4117.     NULL,                       /* 0,27 transparent to Old KOI-8 Cyrillic */
  4118.     NULL,            /* 0,28 transparent to JIS-7 */
  4119.     NULL,            /* 0,29 transparent to Shift-JIS */
  4120.     NULL,            /* 0,30 transparent to J-EUC */
  4121.     NULL,            /* 0,31 transparent to DEC Kanji */
  4122.     NULL,            /* 0,32 transparent to Hebrew-7 */
  4123.     NULL,            /* 0,33 transparent to Latin/Hebrew */
  4124.     NULL,            /* 0,34 transparent to CP862 Hebrew */
  4125.     NULL,            /* 1,0 ascii to us ascii */
  4126.     NULL,            /* 1,1 ascii to uk ascii */
  4127.     NULL,            /* 1,2 ascii to dutch nrc */
  4128.     NULL,            /* 1,3 ascii to finnish nrc */
  4129.     NULL,            /* 1,4 ascii to french nrc */
  4130.     NULL,            /* 1,5 ascii to fr-canadian nrc */
  4131.     NULL,            /* 1,6 ascii to german nrc */
  4132.     NULL,            /* 1,7 ascii to hungarian nrc */
  4133.     NULL,            /* 1,8 ascii to italian nrc */
  4134.     NULL,            /* 1,9 ascii to norge/danish nrc */
  4135.     NULL,            /* 1,10 ascii to portuguese nrc */
  4136.     NULL,            /* 1,11 ascii to spanish nrc */
  4137.     NULL,            /* 1,12 ascii to swedish nrc */
  4138.     NULL,            /* 1,13 ascii to swiss nrc */
  4139.     NULL,            /* 1,14 ascii to latin-1 */
  4140.     NULL,            /* 1,15 ascii to latin-2 */
  4141.     NULL,            /* 1,16 ascii to DEC MCS */
  4142.     NULL,            /* 1,17 ascii to NeXT */
  4143.     NULL,            /* 1,18 ascii to CP437 */
  4144.     NULL,            /* 1,19 ascii to CP850 */
  4145.     NULL,            /* 1,20 ascii to CP852 */
  4146.     NULL,            /* 1,21 ascii to Macintosh Latin */
  4147.     NULL,            /* 1,22 ascii to DGI */
  4148.     NULL,            /* 1,23 ascii to HP */
  4149.     xaslc,                      /* 1,24 ascii to Latin/Cyrillic */
  4150.     xasac,                      /* 1,25 ascii to CP866 */
  4151.     xassk,                      /* 1,26 ascii to Short KOI */
  4152.     xask8,                      /* 1,27 ascii to Old KOI-8 Cyrillic */
  4153.     NULL,            /* 1,28 ascii to JIS-7 */
  4154.     NULL,            /* 1,29 ascii to Shift-JIS */
  4155.     NULL,            /* 1,30 ascii to J-EUC */
  4156.     NULL,            /* 1,31 ascii to DEC Kanji */
  4157.     xash7,            /* 1,32 ascii to Hebrew-7 */
  4158.     NULL,            /* 1,33 ascii to Latin/Hebrew */
  4159.     NULL,            /* 1,34 ascii to CP862 Hebrew */
  4160.     zl1as,            /* 2,0 latin-1 to us ascii */
  4161.     xl1uk,            /* 2,1 latin-1 to uk ascii */
  4162.     xl1du,            /* 2,2 latin-1 to dutch nrc */
  4163.     xl1fi,            /* 2,3 latin-1 to finnish nrc */
  4164.     xl1fr,            /* 2,4 latin-1 to french nrc */
  4165.     xl1fc,            /* 2,5 latin-1 to fr-canadian nrc */
  4166.     xl1ge,            /* 2,6 latin-1 to german nrc */
  4167.     xl1it,            /* 2,7 latin-1 to italian nrc */
  4168.     xl1hu,            /* 2,8 latin-1 to hungarian nrc */
  4169.     xl1no,            /* 2,9 latin-1 to norge/danish nrc */
  4170.     xl1po,            /* 2,10 latin-1 to portuguese nrc */
  4171.     xl1sp,            /* 2,11 latin-1 to spanish nrc */
  4172.     xl1sw,            /* 2,12 latin-1 to swedish nrc */
  4173.     xl1ch,            /* 2,13 latin-1 to swiss nrc */
  4174.     NULL,            /* 2,14 latin-1 to latin-1 */
  4175.     xl1l2,            /* 2,15 latin-1 to latin-2 */
  4176.     xl1dm,            /* 2,16 latin-1 to DEC MCS */
  4177.     xl1ne,            /* 2,17 latin-1 to NeXT */
  4178.     xl143,            /* 2,18 latin-1 to CP437 */
  4179.     xl185,            /* 2,19 latin-1 to CP850 */
  4180.     xl152,            /* 2,20 latin-1 to CP852 */
  4181.     xl1aq,            /* 2,21 latin-1 to Macintosh Latin */
  4182.     xl1dg,            /* 2,22 latin-1 to DGI */
  4183.     xl1r8,            /* 2,23 latin-1 to HP Roman8 */
  4184.     zl1as,            /* 2,24 latin-1 to Latin/Cyrillic */
  4185.     zl1as,                      /* 2,25 latin-1 to CP866 */
  4186.     xl1sk,                      /* 2,26 latin-1 to Short KOI */
  4187.     zl1as,                   /* 2,27 latin-1 to Old KOI-8 Cyrillic */
  4188.     NULL,            /* 2,28 latin-1 to JIS-7 */
  4189.     NULL,            /* 2,29 latin-1 to Shift-JIS */
  4190.     NULL,            /* 2,30 latin-1 to J-EUC */
  4191.     NULL,            /* 2,31 latin-1 to DEC Kanji */
  4192.     xl1h7,            /* 2,32 latin-1 to Hebrew-7 */
  4193.     xl1lh,            /* 2,33 latin-1 to Latin/Hebrew */
  4194.     xl162,            /* 2,34 latin-1 to CP862 Hebrew */
  4195.     xl2as,            /* 3,0 latin-2 to us ascii */
  4196.     xl2as,            /* 3,1 latin-2 to uk ascii */
  4197.     xl2as,            /* 3,2 latin-2 to dutch nrc */
  4198.     xl2as,            /* 3,3 latin-2 to finnish nrc */
  4199.     xl2as,            /* 3,4 latin-2 to french nrc */
  4200.     xl2as,            /* 3,5 latin-2 to fr-canadian nrc */
  4201.     xl2as,            /* 3,6 latin-2 to german nrc */
  4202.     xl2as,            /* 3,7 latin-2 to italian nrc */
  4203.     xl2as,            /* 3,8 latin-2 to hungarian nrc */
  4204.     xl2as,            /* 3,9 latin-2 to norge/danish nrc */
  4205.     xl2as,            /* 3,10 latin-2 to portuguese nrc */
  4206.     xl2as,            /* 3,11 latin-2 to spanish nrc */
  4207.     xl2as,            /* 3,12 latin-2 to swedish nrc */
  4208.     xl2as,            /* 3,13 latin-2 to swiss nrc */
  4209.     xl2l1,            /* 3,14 latin-2 to latin-1 */
  4210.     NULL,            /* 3,15 latin-2 to latin-2 */
  4211.     xl2l1,            /* 3,16 latin-2 to DEC MCS */
  4212.     xl2ne,            /* 3,17 latin-2 to NeXT */
  4213.     xl243,            /* 3,18 latin-2 to CP437 */
  4214.     xl285,            /* 3,19 latin-2 to CP850 */
  4215.     xl252,            /* 3,20 latin-2 to CP852 */
  4216.     xl2aq,            /* 3,21 latin-2 to Macintosh Latin */
  4217.     xl2dg,            /* 3,22 latin-2 to DGI */
  4218.     xl2r8,            /* 3,23 latin-2 to HP */
  4219.     xl2as,            /* 3,24 latin-2 to Latin/Cyrillic */
  4220.     xl2as,                      /* 3,25 latin-2 to CP866 */
  4221.     xl2sk,                      /* 3,26 latin-2 to Short KOI */
  4222.     xl2as,                   /* 3,27 latin-2 to Old KOI-8 Cyrillic */
  4223.     NULL,            /* 3,28 latin-2 to JIS-7 */
  4224.     NULL,            /* 3,29 latin-2 to Shift-JIS */
  4225.     NULL,            /* 3,30 latin-2 to J-EUC */
  4226.     NULL,            /* 3,31 latin-2 to DEC Kanji */
  4227.     xl2h7,            /* 3,32 latin-2 to Hebrew-7 */
  4228.     xl2as,            /* 3,33 latin-2 to Latin/Hebrew */
  4229.     xl2as,            /* 3,34 latin-2 to CP862 Hebrew */
  4230.     xlcas,            /* 4,0 latin/cyrillic to us ascii */
  4231.     xlcas,            /* 4,1 latin/cyrillic to uk ascii */
  4232.     xlcas,                 /* 4,2 latin/cyrillic to dutch nrc */
  4233.     xlcas,            /* 4,3 latin/cyrillic to finnish ascii */
  4234.     xlcas,            /* 4,4 latin/cyrillic to french nrc */
  4235.     xlcas,            /* 4,5 latin/cyrillic to fr-canadian nrc */
  4236.     xlcas,            /* 4,6 latin/cyrillic to german nrc */
  4237.     xlcas,            /* 4,7 latin/cyrillic to italian nrc */
  4238.     xlcas,            /* 4,8 latin/cyrillic to hungarian nrc */
  4239.     xlcas,            /* 4,9 latin/cyrillic to norge/danish nrc */
  4240.     xlcas,            /* 4,10 latin/cyrillic to portuguese nrc */
  4241.     xlcas,            /* 4,11 latin/cyrillic to spanish nrc */
  4242.     xlcas,            /* 4,12 latin/cyrillic to swedish nrc */
  4243.     xlcas,            /* 4,13 latin/cyrillic to swiss nrc */
  4244.     xlcas,            /* 4,14 latin/cyrillic to latin-1 */
  4245.     xlcas,            /* 4,15 latin/cyrillic to latin-2 */
  4246.     xlcas,            /* 4,16 latin/cyrillic to DEC MCS */
  4247.     xlcas,            /* 4,17 latin/cyrillic to NeXT */
  4248.     xlcas,            /* 4,18 latin/cyrillic to CP437 */
  4249.     xlcas,            /* 4,19 latin/cyrillic to CP850 */
  4250.     xlcas,            /* 4,20 latin/cyrillic to CP852 */
  4251.     xlcas,            /* 4,21 latin/cyrillic to Macintosh Latin */
  4252.     xlcas,            /* 4,22 latin/cyrillic to DGI */
  4253.     xlcas,            /* 4,23 latin/cyrillic to HP */
  4254.     NULL,                       /* 4,24 latin/cyrillic to Latin/Cyrillic */
  4255.     xlcac,                      /* 4,25 latin/cyrillic to CP866 */
  4256.     xlcsk,                      /* 4,26 latin/cyrillic to Short KOI */
  4257.     xlck8,                   /* 4,27 latin/cyrillic to Old KOI-8 Cyrillic */
  4258.     NULL,            /* 4,28 latin/cyril to JIS-7 */
  4259.     NULL,            /* 4,29 latin/cyril to Shift-JIS */
  4260.     NULL,            /* 4,30 latin/cyril to J-EUC */
  4261.     NULL,            /* 4,31 latin/cyril to DEC Kanji */
  4262.     xlch7,            /* 4,32 latin/cyril to Hebrew-7 */
  4263.     xlcas,            /* 4,33 latin/cyril to Latin/Hebrew */
  4264.     xlcas,            /* 4,34 latin/cyril to CP862 Hebrew */
  4265.  
  4266. /* Kanji to others ... */
  4267.  
  4268.     NULL,            /* 5,00 */
  4269.     NULL,            /* 5,01 */
  4270.     NULL,            /* 5,02 */
  4271.     NULL,            /* 5,03 */
  4272.     NULL,            /* 5,04 */
  4273.     NULL,            /* 5,05 */
  4274.     NULL,            /* 5,06 */
  4275.     NULL,            /* 5,07 */
  4276.     NULL,            /* 5,08 */
  4277.     NULL,            /* 5,09 */
  4278.     NULL,            /* 5,10 */
  4279.     NULL,            /* 5,11 */
  4280.     NULL,            /* 5,12 */
  4281.     NULL,            /* 5,13 */
  4282.     NULL,            /* 5,14 */
  4283.     NULL,            /* 5,15 */
  4284.     NULL,            /* 5,16 */
  4285.     NULL,            /* 5,17 */
  4286.     NULL,            /* 5,18 */
  4287.     NULL,            /* 5,19 */
  4288.     NULL,            /* 5,20 */
  4289.     NULL,            /* 5,21 */
  4290.     NULL,            /* 5,22 */
  4291.     NULL,            /* 5,23 */
  4292.     NULL,            /* 5,24 */
  4293.     NULL,            /* 5,25 */
  4294.     NULL,            /* 5,26 */
  4295.     NULL,            /* 5,27 */
  4296.     NULL,            /* 5,28 */
  4297.     NULL,            /* 5,29 */
  4298.     NULL,            /* 5,30 */
  4299.     NULL,            /* 5,31 */
  4300.     NULL,            /* 5,32 */
  4301.     NULL,            /* 5,33 */
  4302.     NULL,            /* 5,34 */
  4303. /* Latin/Hebrew to others */
  4304.     xlhas,            /* 6,0 latin/hebrew to us ascii */
  4305.     xlhas,            /* 6,1 latin/hebrew to uk ascii */
  4306.     xlhas,                 /* 6,2 latin/hebrew to dutch nrc */
  4307.     xlhas,            /* 6,3 latin/hebrew to finnish ascii */
  4308.     xlhas,            /* 6,4 latin/hebrew to french nrc */
  4309.     xlhas,            /* 6,5 latin/hebrew to fr-canadian nrc */
  4310.     xlhas,            /* 6,6 latin/hebrew to german nrc */
  4311.     xlhas,            /* 6,7 latin/hebrew to italian nrc */
  4312.     xlhas,            /* 6,8 latin/hebrew to hungarian nrc */
  4313.     xlhas,            /* 6,9 latin/hebrew to norge/danish nrc */
  4314.     xlhas,            /* 6,10 latin/hebrew to portuguese nrc */
  4315.     xlhas,            /* 6,11 latin/hebrew to spanish nrc */
  4316.     xlhas,            /* 6,12 latin/hebrew to swedish nrc */
  4317.     xlhas,            /* 6,13 latin/hebrew to swiss nrc */
  4318.     xlhl1,            /* 6,14 latin/hebrew to latin-1 */
  4319.     xlhas,            /* 6,15 latin/hebrew to latin-2 */
  4320.     xlhl1,            /* 6,16 latin/hebrew to DEC MCS */
  4321.     xlhas,            /* 6,17 latin/hebrew to NeXT */
  4322.     xlhas,            /* 6,18 latin/hebrew to CP437 */
  4323.     xlhas,            /* 6,19 latin/hebrew to CP850 */
  4324.     xlhas,            /* 6,20 latin/hebrew to CP852 */
  4325.     xlhas,            /* 6,21 latin/hebrew to Macintosh Latin */
  4326.     xlhas,            /* 6,22 latin/hebrew to DGI */
  4327.     xlhas,                      /* 6,23 latin/hebrew to HP */
  4328.     xlhas,                      /* 6,24 latin/hebrew to Latin/Cyrillic */
  4329.     xlhas,                      /* 6,25 latin/hebrew to CP866 */
  4330.     NULL,                       /* 6,26 latin/hebrew to Short KOI */
  4331.     xlhas,                   /* 6,27 latin/hebrew to Old KOI-8 Cyrillic */
  4332.     NULL,            /* 6,28 latin/hebrew to JIS-7 */
  4333.     NULL,            /* 6,29 latin/hebrew to Shift-JIS */
  4334.     NULL,            /* 6,30 latin/hebrew to J-EUC */
  4335.     NULL,            /* 6,31 latin/hebrew to DEC Kanji */
  4336.     xlhh7,            /* 6,32 latin/hebrew to Hebrew-7 */
  4337.     NULL,            /* 6,33 latin/hebrew to Latin/Hebrew */
  4338.     xlh62            /* 6,34 latin/hebrew to CP862 Hebrew */
  4339. };
  4340.  
  4341. /*
  4342.   Translation function table for sending files.
  4343.   Array of pointers to functions for translating from the local file
  4344.   character set to the transfer syntax character set.  Indexed in the same
  4345.   way as the xlr array above.
  4346. */
  4347. #ifdef CK_ANSIC
  4348. CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])(CHAR) =
  4349. #else
  4350. CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])() =
  4351. #endif /* CK_ANSIC */
  4352. {
  4353.     NULL,            /* 0,0 us ascii to transparent */
  4354.     NULL,            /* 0,1 uk ascii to transparent */
  4355.     NULL,            /* 0,2 dutch nrc to transparent */
  4356.     NULL,            /* 0,3 finnish nrc to transparent */
  4357.     NULL,            /* 0,4 french nrc to transparent */
  4358.     NULL,            /* 0,5 fr-canadian nrc to transparent */
  4359.     NULL,            /* 0,6 german nrc to transparent */
  4360.     NULL,            /* 0,7 hungarian nrc to transparent */
  4361.     NULL,            /* 0,8 italian nrc to transparent */
  4362.     NULL,            /* 0,9 norge/danish nrc to transparent */
  4363.     NULL,            /* 0,10 portuguese nrc to transparent */
  4364.     NULL,            /* 0,11 spanish nrc to transparent */
  4365.     NULL,            /* 0,12 swedish nrc to transparent */
  4366.     NULL,            /* 0,13 swiss nrc to transparent */
  4367.     NULL,            /* 0,14 latin-1 to transparent */
  4368.     NULL,            /* 0,15 latin-2 to transparent */
  4369.     NULL,            /* 0,16 DEC MCS to transparent */
  4370.     NULL,            /* 0,17 NeXT to transparent */
  4371.     NULL,            /* 0,18 CP437 to transparent */
  4372.     NULL,            /* 0,19 CP850 to transparent */
  4373.     NULL,            /* 0,20 CP852 to transparent */
  4374.     NULL,            /* 0,21 Macintosh Latin to transparent */
  4375.     NULL,            /* 0,22 DGI to transparent */
  4376.     NULL,            /* 0,23 HP to transparent */
  4377.     NULL,            /* 0,24 Latin/Cyrillic to transparent */
  4378.     NULL,                       /* 0,25 CP866 to transparent */
  4379.     NULL,                       /* 0,26 Short KOI to transparent */
  4380.     NULL,                       /* 0,27 Old KOI-8 to transparent */
  4381.     NULL,            /* 0,28 JIS-7 to transparent */
  4382.     NULL,            /* 0,29 Shift JIS to transparent */
  4383.     NULL,            /* 0,30 Japanese EUC to transparent */
  4384.     NULL,            /* 0,31 DEC Kanji to transparent */
  4385.     NULL,            /* 0,32 Hebrew-7 to transparent */
  4386.     NULL,            /* 0,33 Latin/Hebrew to transparent */
  4387.     NULL,            /* 0,34 CP862 Hebrew to transparent */
  4388.     NULL,            /* 1,0 us ascii to ascii */
  4389.     NULL,            /* 1,1 uk ascii to ascii */
  4390.     xduas,            /* 1,2 dutch nrc to ascii */
  4391.     xfias,            /* 1,3 finnish nrc to ascii */
  4392.     xfras,            /* 1,4 french nrc to ascii */
  4393.     xfcas,            /* 1,5 french canadian nrc to ascii */
  4394.     xgeas,            /* 1,6 german nrc to ascii */
  4395.     xhuas,            /* 1,7 hungarian nrc to ascii */
  4396.     xitas,            /* 1,8 italian nrc to ascii */
  4397.     xnoas,            /* 1,9 norwegian/danish nrc to ascii */
  4398.     xpoas,            /* 1,10 portuguese nrc to ascii */
  4399.     xspas,            /* 1,11 spanish nrc to ascii */
  4400.     xswas,            /* 1,12 swedish nrc to ascii */
  4401.     xchas,            /* 1,13 swiss nrc to ascii */
  4402.     xl1as,            /* 1,14 latin-1 to ascii */
  4403.     xl2as,            /* 1,15 latin-2 to ascii */
  4404.     xdmas,            /* 1,16 dec mcs to ascii */
  4405.     xneas,            /* 1,17 NeXT to ascii */
  4406.     x43as,            /* 1,18 CP437 to ascii */
  4407.     x85as,            /* 1,19 CP850 to ascii */
  4408.     x52as,            /* 1,20 CP850 to ascii */
  4409.     xaqas,            /* 1,21 Macintosh Latin to ascii */
  4410.     xdgas,            /* 1,22 DGI to ascii */
  4411.     xr8as,            /* 1,23 HP to ASCII */
  4412.     xlcas,            /* 1,24 Latin/Cyrillic to ASCII */
  4413.     xacas,                      /* 1,25 CP866 to ASCII */
  4414.     xskas,            /* 1,26 Short KOI to ASCII */
  4415.     xk8as,                      /* 1,27 Old KOI-8 Cyrillic to ASCII */
  4416.     NULL,            /* 1,28 */
  4417.     NULL,            /* 1,29 */
  4418.     NULL,            /* 1,30 */
  4419.     NULL,            /* 1,31 */
  4420.     xh7as,            /* 1,32 Hebrew-7 to ASCII */
  4421.     xlhas,            /* 1,33 Latin/Hebrew to ASCII */
  4422.     x62as,            /* 1,34 CP862 Hebrew to ASCII */
  4423.     NULL,            /* 2,0 us ascii to latin-1 */
  4424.     xukl1,            /* 2,1 uk ascii to latin-1 */
  4425.     xdul1,            /* 2,2 dutch nrc to latin-1 */
  4426.     xfil1,            /* 2,3 finnish nrc to latin-1 */
  4427.     xfrl1,            /* 2,4 french nrc to latin-1 */
  4428.     xfcl1,            /* 2,5 french canadian nrc to latin-1 */
  4429.     xgel1,            /* 2,6 german nrc to latin-1 */
  4430.     xhul1,            /* 2,7 hungarian nrc to latin-1 */
  4431.     xitl1,            /* 2,8 italian nrc to latin-1 */
  4432.     xnol1,            /* 2,9 norwegian/danish nrc to latin-1 */
  4433.     xpol1,            /* 2,10 portuguese nrc to latin-1 */
  4434.     xspl1,            /* 2,11 spanish nrc to latin-1 */
  4435.     xswl1,            /* 2,12 swedish nrc to latin-1 */
  4436.     xchl1,            /* 2,13 swiss nrc to latin-1 */
  4437.     NULL,            /* 2,14 latin-1 to latin-1 */
  4438.     xl2l1,            /* 2,15 latin-2 to latin-1 */
  4439.     xdml1,            /* 2,16 dec mcs to latin-1 */
  4440.     xnel1,                      /* 2,17 NeXT to Latin-1 */
  4441.     x43l1,                      /* 2,18 CP437 to Latin-1 */
  4442.     x85l1,                      /* 2,19 CP850 to Latin-1 */
  4443.     x52l1,                      /* 2,20 CP852 to Latin-1 */
  4444.     xaql1,                      /* 2,21 Macintosh Latin to Latin-1 */
  4445.     xdgl1,                      /* 2,22 DGI to Latin-1 */
  4446.     xr8l1,                      /* 2,23 HP to Latin-1 */
  4447.     xlcas,                      /* 2,24 Latin/Cyrillic to Latin-1 */
  4448.     xacas,                      /* 2,25 CP866 to Latin-1 */
  4449.     xskas,                      /* 2,26 Short KOI to Latin-1 */
  4450.     xk8as,                      /* 2,27 Old KOI-8 Cyrillic to Latin-1 */
  4451.     NULL,            /* 2,28 Kanji ... */
  4452.     NULL,            /* 2,29 */
  4453.     NULL,            /* 2,30 */
  4454.     NULL,            /* 2,32 */
  4455.     xh7as,            /* 2,32 Hebrew-7 to Latin-1 */
  4456.     xlhl1,            /* 2,33 Latin/Hebrew to Latin-1 */
  4457.     x62l1,            /* 2,34 CP862 Hebrew to Latin-1 */
  4458.     NULL,            /* 3,0 us ascii to latin-2 */
  4459.     NULL,            /* 3,1 uk ascii to latin-2 */
  4460.     xduas,            /* 3,2 dutch nrc to latin-2 */
  4461.     xfias,            /* 3,3 finnish nrc to latin-2 */
  4462.     xfras,            /* 3,4 french nrc to latin-2 */
  4463.     xfcas,            /* 3,5 french canadian nrc to latin-2 */
  4464.     xgel2,            /* 3,6 german nrc to latin-2 */
  4465.     xhul2,            /* 3,7 hungarian nrc to latin-2 */
  4466.     xitas,            /* 3,8 italian nrc to latin-2 */
  4467.     xnoas,            /* 3,9 norwegian/danish nrc to latin-2 */
  4468.     xpoas,            /* 3,10 portuguese nrc to latin-2 */
  4469.     xspas,            /* 3,11 spanish nrc to latin-2 */
  4470.     xswas,            /* 3,12 swedish nrc to latin-2 */
  4471.     xchas,            /* 3,13 swiss nrc to latin-2 */
  4472.     xl1l2,            /* 3,14 latin-1 to latin-2 */
  4473.     NULL,            /* 3,15 latin-2 to latin-2 */
  4474.     xl1l2,            /* 3,16 dec mcs to latin-2 */
  4475.     xnel2,                      /* 3,17 NeXT to Latin-2 */
  4476.     x43l2,                      /* 3,18 CP437 to Latin-2 */
  4477.     x85l2,                      /* 3,19 CP850 to Latin-2 */
  4478.     x52l2,                      /* 3,20 CP852 to Latin-2 */
  4479.     xaql2,                      /* 3,21 Macintosh Latin to Latin-2 */
  4480.     xdgl2,                      /* 3,22 DGI to Latin-2 */
  4481.     xr8l2,                      /* 3,22 HP to Latin-2 */
  4482.     xlcas,                      /* 3,24 Latin/Cyrillic to Latin-2 */
  4483.     xacas,                      /* 3,25 CP866 to Latin-2 */
  4484.     xskas,                      /* 3,26 Short KOI to Latin-2 */
  4485.     xk8as,                      /* 3,27 Old KOI-8 Cyrillic to Latin-2 */
  4486.     NULL,            /* 3,28 Kanji ... */
  4487.     NULL,            /* 3,29 */
  4488.     NULL,            /* 3,30 */
  4489.     NULL,            /* 3,31 */
  4490.     xh7as,            /* 3,32 Hebrew-7 to Latin-2 */
  4491.     xlhas,            /* 3,33 Latin/Hebrew to Latin-2 */
  4492.     x62as,            /* 3,34 CP862 Hebrew to Latin-2 */
  4493.     xaslc,            /* 4,0 us ascii to latin/cyrillic */
  4494.     xaslc,            /* 4,1 uk ascii to latin/cyrillic */
  4495.     xduas,            /* 4,2 dutch nrc to latin/cyrillic */
  4496.     xfias,            /* 4,3 finnish nrc to latin/cyrillic */
  4497.     xfras,            /* 4,4 french nrc to latin/cyrillic */
  4498.     xfcas,            /* 4,5 french canadian nrc to latin/cyrillic */
  4499.     xgeas,            /* 4,6 german nrc to latin/cyrillic */
  4500.     xhuas,            /* 4,7 hungarian nrc to latin/cyrillic */
  4501.     xitas,            /* 4,8 italian nrc to latin/cyrillic */
  4502.     xnoas,            /* 4,9 norge/danish nrc to latin/cyrillic */
  4503.     xpoas,            /* 4,10 portuguese nrc to latin/cyrillic */
  4504.     xspas,            /* 4,11 spanish nrc to latin/cyrillic */
  4505.     xswas,            /* 4,12 swedish nrc to latin/cyrillic */
  4506.     xchas,            /* 4,13 swiss nrc to latin/cyrillic */
  4507.     xl1as,            /* 4,14 latin-1 to latin/cyrillic */
  4508.     xl2as,            /* 4,15 latin-2 to latin/cyrillic */
  4509.     xdmas,            /* 4,16 dec mcs to latin/cyrillic */
  4510.     xneas,            /* 4,17 NeXT to latin/cyrillic */
  4511.     x43as,            /* 4,18 CP437 to latin/cyrillic */
  4512.     x85as,            /* 4,19 CP850 to latin/cyrillic */
  4513.     x52as,            /* 4,20 CP852 to latin/cyrillic */
  4514.     xaqas,            /* 4,21 Macintosh Latin to latin/cyrillic */
  4515.     xdgas,            /* 4,22 DGI to Latin/Cyrillic */
  4516.     xr8as,            /* 4,23 HP to Latin/Cyrillic */
  4517.     NULL,                       /* 4,24 Latin/Cyrillic to Latin/Cyrillic */
  4518.     xaclc,                      /* 4,25 CP866 to Latin/Cyrillic */
  4519.     xskcy,                      /* 4,26 Short KOI to Latin/Cyrillic */
  4520.     xk8lc,                      /* 4,27 Old KOI-8 Cyrillic to Latin/Cyrillic */
  4521.     NULL,            /* 4,28 Kanji... */
  4522.     NULL,            /* 4,29 */
  4523.     NULL,            /* 4,30 */
  4524.     NULL,            /* 4,31 */
  4525.     xh7as,            /* 4,32 Hebrew-7 to Latin/Cyrillic */
  4526.     xlhas,            /* 4,33 Latin/Hebrew to Latin/Cyrillic */
  4527.     x62as,            /* 4,34 CP862 Hebrew to Latin/Cyrillic */
  4528.     NULL,            /* 5,00 */
  4529.     NULL,            /* 5,01 */
  4530.     NULL,            /* 5,02 */
  4531.     NULL,            /* 5,03 */
  4532.     NULL,            /* 5,04 */
  4533.     NULL,            /* 5,05 */
  4534.     NULL,            /* 5,06 */
  4535.     NULL,            /* 4.07 */
  4536.     NULL,            /* 5,08 */
  4537.     NULL,            /* 5,09 */
  4538.     NULL,            /* 5,10 */
  4539.     NULL,            /* 5,11 */
  4540.     NULL,            /* 5,12 */
  4541.     NULL,            /* 5,13 */
  4542.     NULL,            /* 5,14 */
  4543.     NULL,            /* 5,15 */
  4544.     NULL,            /* 5,16 */
  4545.     NULL,            /* 5,17 */
  4546.     NULL,            /* 5,18 */
  4547.     NULL,            /* 5,19 */
  4548.     NULL,            /* 5,20 */
  4549.     NULL,            /* 5,21 */
  4550.     NULL,            /* 5,22 */
  4551.     NULL,            /* 5,23 */
  4552.     NULL,            /* 5,24 */
  4553.     NULL,            /* 5,25 */
  4554.     NULL,            /* 5,26 */
  4555.     NULL,            /* 5,27 */
  4556.     NULL,            /* 5,28 */
  4557.     NULL,            /* 5,29 */
  4558.     NULL,            /* 5,30 */
  4559.     NULL,            /* 5,31 */
  4560.     NULL,            /* 5,32 */
  4561.     NULL,            /* 5,33 */
  4562.     NULL,            /* 5,34 */
  4563.     NULL,            /* 6,0 us ascii to Latin/Hebrew */
  4564.     NULL,            /* 6,1 uk ascii to Latin/Hebrew */
  4565.     xduas,            /* 6,2 dutch nrc to Latin/Hebrew */
  4566.     xfias,            /* 6,3 finnish nrc to Latin/Hebrew */
  4567.     xfras,            /* 6,4 french nrc to Latin/Hebrew */
  4568.     xfcas,            /* 6,5 french canadian nrc to Latin/Hebrew */
  4569.     xgeas,            /* 6,6 german nrc to Latin/Hebrew */
  4570.     xhuas,            /* 6,7 hungarian nrc to Latin/Hebrew */
  4571.     xitas,            /* 6,8 italian nrc to Latin/Hebrew */
  4572.     xnoas,            /* 6,9 norge/danish nrc to Latin/Hebrew */
  4573.     xpoas,            /* 6,10 portuguese nrc to Latin/Hebrew */
  4574.     xspas,            /* 6,11 spanish nrc to Latin/Hebrew */
  4575.     xswas,            /* 6,12 swedish nrc to Latin/Hebrew */
  4576.     xchas,            /* 6,13 swiss nrc to Latin/Hebrew */
  4577.     xl1lh,            /* 6,14 latin-1 to Latin/Hebrew */
  4578.     xl2as,            /* 6,15 latin-2 to Latin/Hebrew */
  4579.     xdmas,            /* 6,16 dec mcs to Latin/Hebrew */
  4580.     xneas,            /* 6,17 NeXT to Latin/Hebrew */
  4581.     x43as,            /* 6,18 CP437 to Latin/Hebrew */
  4582.     x85as,            /* 6,19 CP850 to Latin/Hebrew */
  4583.     x52as,            /* 6,20 CP852 to Latin/Hebrew */
  4584.     xaqas,            /* 6,21 Macintosh Latin to Latin/Hebrew */
  4585.     xdgas,            /* 6,22 DGI to Latin/Hebrew */
  4586.     xr8as,            /* 6,23 HP to Latin/Hebrew */
  4587.     xlcas,                      /* 6,24 Latin/Cyrillic to Latin/Hebrew */
  4588.     xacas,                      /* 6,25 CP866 to Latin/Hebrew */
  4589.     xskas,                      /* 6,26 Short KOI to Latin/Hebrew */
  4590.     xk8as,                      /* 6,27 Old KOI-8 Cyrillic to Latin/Hebrew */
  4591.     NULL,            /* 6,28 Kanji... */
  4592.     NULL,            /* 4,29 */
  4593.     NULL,            /* 4,30 */
  4594.     NULL,            /* 4,31 */
  4595.     xh7lh,            /* 4,32 Hebrew-7 to Latin/Hebrew */
  4596.     NULL,            /* 6,33 Latin/Hebrew to Latin/Hebrew */
  4597.     x62lh            /* 6,34 CP862 Hebrew to Latin/Hebrew */
  4598. };
  4599. #endif /* NOCSETS */
  4600.