ckcuni.c
上传用户:dufan58
上传日期:2007-01-05
资源大小:3407k
文件大小:695k
源码类别:

通讯/手机编程

开发平台:

Windows_Unix

  1.       case 0x00a3: return((CHAR)(156 & 0xff));
  2.       case 0x00a4: return((CHAR)(207 & 0xff));
  3.       case 0x00a5: return((CHAR)(190 & 0xff));
  4.       case 0x00a6: return((CHAR)(221 & 0xff));
  5.       case 0x00a7: return((CHAR)(245 & 0xff));
  6.       case 0x00a8: return((CHAR)(249 & 0xff));
  7.       case 0x00a9: return((CHAR)(184 & 0xff));
  8.       case 0x00aa: return((CHAR)(166 & 0xff));
  9.       case 0x00ab: return((CHAR)(174 & 0xff));
  10.       case 0x00ac: return((CHAR)(170 & 0xff));
  11.       case 0x00ad: return((CHAR)(240 & 0xff));
  12.       case 0x00ae: return((CHAR)(169 & 0xff));
  13.       case 0x00af: return((CHAR)(238 & 0xff));
  14.       case 0x00b0: return((CHAR)(248 & 0xff));
  15.       case 0x00b1: return((CHAR)(241 & 0xff));
  16.       case 0x00b2: return((CHAR)(253 & 0xff));
  17.       case 0x00b3: return((CHAR)(252 & 0xff));
  18.       case 0x00b4: return((CHAR)(239 & 0xff));
  19.       case 0x00b5: return((CHAR)(230 & 0xff));
  20.       case 0x00b6: return((CHAR)(244 & 0xff));
  21.       case 0x00b7: return((CHAR)(250 & 0xff));
  22.       case 0x00b8: return((CHAR)(247 & 0xff));
  23.       case 0x00b9: return((CHAR)(251 & 0xff));
  24.       case 0x00ba: return((CHAR)(167 & 0xff));
  25.       case 0x00bb: return((CHAR)(175 & 0xff));
  26.       case 0x00bc: return((CHAR)(172 & 0xff));
  27.       case 0x00bd: return((CHAR)(171 & 0xff));
  28.       case 0x00be: return((CHAR)(243 & 0xff));
  29.       case 0x00bf: return((CHAR)(168 & 0xff));
  30.       case 0x00c0: return((CHAR)(183 & 0xff));
  31.       case 0x00c1: return((CHAR)(181 & 0xff));
  32.       case 0x00c2: return((CHAR)(182 & 0xff));
  33.       case 0x00c3: return((CHAR)(199 & 0xff));
  34.       case 0x00c4: return((CHAR)(142 & 0xff));
  35.       case 0x00c5: return((CHAR)(143 & 0xff));
  36.       case 0x00c6: return((CHAR)(146 & 0xff));
  37.       case 0x00c7: return((CHAR)(128 & 0xff));
  38.       case 0x00c8: return((CHAR)(212 & 0xff));
  39.       case 0x00c9: return((CHAR)(144 & 0xff));
  40.       case 0x00ca: return((CHAR)(210 & 0xff));
  41.       case 0x00cb: return((CHAR)(211 & 0xff));
  42.       case 0x00cc: return((CHAR)(222 & 0xff));
  43.       case 0x00cd: return((CHAR)(214 & 0xff));
  44.       case 0x00ce: return((CHAR)(215 & 0xff));
  45.       case 0x00cf: return((CHAR)(216 & 0xff));
  46.       case 0x00d0: return((CHAR)(209 & 0xff));
  47.       case 0x00d1: return((CHAR)(165 & 0xff));
  48.       case 0x00d2: return((CHAR)(227 & 0xff));
  49.       case 0x00d3: return((CHAR)(224 & 0xff));
  50.       case 0x00d4: return((CHAR)(226 & 0xff));
  51.       case 0x00d5: return((CHAR)(229 & 0xff));
  52.       case 0x00d6: return((CHAR)(153 & 0xff));
  53.       case 0x00d7: return((CHAR)(158 & 0xff));
  54.       case 0x00d8: return((CHAR)(157 & 0xff));
  55.       case 0x00d9: return((CHAR)(235 & 0xff));
  56.       case 0x00da: return((CHAR)(233 & 0xff));
  57.       case 0x00db: return((CHAR)(234 & 0xff));
  58.       case 0x00dc: return((CHAR)(154 & 0xff));
  59.       case 0x00dd: return((CHAR)(237 & 0xff));
  60.       case 0x00de: return((CHAR)(232 & 0xff));
  61.       case 0x00df: return((CHAR)(225 & 0xff));
  62.       case 0x00e0: return((CHAR)(133 & 0xff));
  63.       case 0x00e1: return((CHAR)(160 & 0xff));
  64.       case 0x00e2: return((CHAR)(131 & 0xff));
  65.       case 0x00e3: return((CHAR)(198 & 0xff));
  66.       case 0x00e4: return((CHAR)(132 & 0xff));
  67.       case 0x00e5: return((CHAR)(134 & 0xff));
  68.       case 0x00e6: return((CHAR)(145 & 0xff));
  69.       case 0x00e7: return((CHAR)(135 & 0xff));
  70.       case 0x00e8: return((CHAR)(138 & 0xff));
  71.       case 0x00e9: return((CHAR)(130 & 0xff));
  72.       case 0x00ea: return((CHAR)(136 & 0xff));
  73.       case 0x00eb: return((CHAR)(137 & 0xff));
  74.       case 0x00ec: return((CHAR)(141 & 0xff));
  75.       case 0x00ed: return((CHAR)(161 & 0xff));
  76.       case 0x00ee: return((CHAR)(140 & 0xff));
  77.       case 0x00ef: return((CHAR)(139 & 0xff));
  78.       case 0x00f0: return((CHAR)(208 & 0xff));
  79.       case 0x00f1: return((CHAR)(164 & 0xff));
  80.       case 0x00f2: return((CHAR)(149 & 0xff));
  81.       case 0x00f3: return((CHAR)(162 & 0xff));
  82.       case 0x00f4: return((CHAR)(147 & 0xff));
  83.       case 0x00f5: return((CHAR)(228 & 0xff));
  84.       case 0x00f6: return((CHAR)(148 & 0xff));
  85.       case 0x00f7: return((CHAR)(246 & 0xff));
  86.       case 0x00f8: return((CHAR)(155 & 0xff));
  87.       case 0x00f9: return((CHAR)(151 & 0xff));
  88.       case 0x00fa: return((CHAR)(163 & 0xff));
  89.       case 0x00fb: return((CHAR)(150 & 0xff));
  90.       case 0x00fc: return((CHAR)(129 & 0xff));
  91.       case 0x00fd: return((CHAR)(236 & 0xff));
  92.       case 0x00fe: return((CHAR)(231 & 0xff));
  93.       case 0x00ff: return((CHAR)(152 & 0xff));
  94.       case 0x0131: return((CHAR)(213 & 0xff));
  95.       case 0x0192: return((CHAR)(159 & 0xff));
  96.       case 0x2017: return((CHAR)(242 & 0xff));
  97.       case 0x2500: return((CHAR)(196 & 0xff));
  98.       case 0x2502: return((CHAR)(179 & 0xff));
  99.       case 0x250c: return((CHAR)(218 & 0xff));
  100.       case 0x2510: return((CHAR)(191 & 0xff));
  101.       case 0x2514: return((CHAR)(192 & 0xff));
  102.       case 0x2518: return((CHAR)(217 & 0xff));
  103.       case 0x251c: return((CHAR)(195 & 0xff));
  104.       case 0x2524: return((CHAR)(180 & 0xff));
  105.       case 0x252c: return((CHAR)(194 & 0xff));
  106.       case 0x2534: return((CHAR)(193 & 0xff));
  107.       case 0x253c: return((CHAR)(197 & 0xff));
  108.       case 0x2550: return((CHAR)(205 & 0xff));
  109.       case 0x2551: return((CHAR)(186 & 0xff));
  110.       case 0x2554: return((CHAR)(201 & 0xff));
  111.       case 0x2557: return((CHAR)(187 & 0xff));
  112.       case 0x255a: return((CHAR)(200 & 0xff));
  113.       case 0x255d: return((CHAR)(188 & 0xff));
  114.       case 0x2560: return((CHAR)(204 & 0xff));
  115.       case 0x2563: return((CHAR)(185 & 0xff));
  116.       case 0x2566: return((CHAR)(203 & 0xff));
  117.       case 0x2569: return((CHAR)(202 & 0xff));
  118.       case 0x256c: return((CHAR)(206 & 0xff));
  119.       case 0x2580: return((CHAR)(223 & 0xff));
  120.       case 0x2584: return((CHAR)(220 & 0xff));
  121.       case 0x2588: return((CHAR)(219 & 0xff));
  122.       case 0x2591: return((CHAR)(176 & 0xff));
  123.       case 0x2592: return((CHAR)(177 & 0xff));
  124.       case 0x2593: return((CHAR)(178 & 0xff));
  125.       case 0x25a0: return((CHAR)(254 & 0xff));
  126.       default: return(tx_cpsub(c)); /* For box characters etc */
  127.     }
  128. }
  129. int /* PC Code Page 858 */
  130. #ifdef CK_ANSIC
  131. tx_cp858(USHORT c)
  132. #else
  133. tx_cp858(c) USHORT c;
  134. #endif /* CK_ANSIC */
  135. {
  136.     if (c < 0x80) /* Has C1 graphics */
  137.       return((CHAR)(c & 0xff));
  138.     switch (c) {
  139.       case 0x00a0: return((CHAR)(255 & 0xff));
  140.       case 0x00a1: return((CHAR)(173 & 0xff));
  141.       case 0x00a2: return((CHAR)(189 & 0xff));
  142.       case 0x00a3: return((CHAR)(156 & 0xff));
  143.       case 0x00a4: return((CHAR)(207 & 0xff));
  144.       case 0x00a5: return((CHAR)(190 & 0xff));
  145.       case 0x00a6: return((CHAR)(221 & 0xff));
  146.       case 0x00a7: return((CHAR)(245 & 0xff));
  147.       case 0x00a8: return((CHAR)(249 & 0xff));
  148.       case 0x00a9: return((CHAR)(184 & 0xff));
  149.       case 0x00aa: return((CHAR)(166 & 0xff));
  150.       case 0x00ab: return((CHAR)(174 & 0xff));
  151.       case 0x00ac: return((CHAR)(170 & 0xff));
  152.       case 0x00ad: return((CHAR)(240 & 0xff));
  153.       case 0x00ae: return((CHAR)(169 & 0xff));
  154.       case 0x00af: return((CHAR)(238 & 0xff));
  155.       case 0x00b0: return((CHAR)(248 & 0xff));
  156.       case 0x00b1: return((CHAR)(241 & 0xff));
  157.       case 0x00b2: return((CHAR)(253 & 0xff));
  158.       case 0x00b3: return((CHAR)(252 & 0xff));
  159.       case 0x00b4: return((CHAR)(239 & 0xff));
  160.       case 0x00b5: return((CHAR)(230 & 0xff));
  161.       case 0x00b6: return((CHAR)(244 & 0xff));
  162.       case 0x00b7: return((CHAR)(250 & 0xff));
  163.       case 0x00b8: return((CHAR)(247 & 0xff));
  164.       case 0x00b9: return((CHAR)(251 & 0xff));
  165.       case 0x00ba: return((CHAR)(167 & 0xff));
  166.       case 0x00bb: return((CHAR)(175 & 0xff));
  167.       case 0x00bc: return((CHAR)(172 & 0xff));
  168.       case 0x00bd: return((CHAR)(171 & 0xff));
  169.       case 0x00be: return((CHAR)(243 & 0xff));
  170.       case 0x00bf: return((CHAR)(168 & 0xff));
  171.       case 0x00c0: return((CHAR)(183 & 0xff));
  172.       case 0x00c1: return((CHAR)(181 & 0xff));
  173.       case 0x00c2: return((CHAR)(182 & 0xff));
  174.       case 0x00c3: return((CHAR)(199 & 0xff));
  175.       case 0x00c4: return((CHAR)(142 & 0xff));
  176.       case 0x00c5: return((CHAR)(143 & 0xff));
  177.       case 0x00c6: return((CHAR)(146 & 0xff));
  178.       case 0x00c7: return((CHAR)(128 & 0xff));
  179.       case 0x00c8: return((CHAR)(212 & 0xff));
  180.       case 0x00c9: return((CHAR)(144 & 0xff));
  181.       case 0x00ca: return((CHAR)(210 & 0xff));
  182.       case 0x00cb: return((CHAR)(211 & 0xff));
  183.       case 0x00cc: return((CHAR)(222 & 0xff));
  184.       case 0x00cd: return((CHAR)(214 & 0xff));
  185.       case 0x00ce: return((CHAR)(215 & 0xff));
  186.       case 0x00cf: return((CHAR)(216 & 0xff));
  187.       case 0x00d0: return((CHAR)(209 & 0xff));
  188.       case 0x00d1: return((CHAR)(165 & 0xff));
  189.       case 0x00d2: return((CHAR)(227 & 0xff));
  190.       case 0x00d3: return((CHAR)(224 & 0xff));
  191.       case 0x00d4: return((CHAR)(226 & 0xff));
  192.       case 0x00d5: return((CHAR)(229 & 0xff));
  193.       case 0x00d6: return((CHAR)(153 & 0xff));
  194.       case 0x00d7: return((CHAR)(158 & 0xff));
  195.       case 0x00d8: return((CHAR)(157 & 0xff));
  196.       case 0x00d9: return((CHAR)(235 & 0xff));
  197.       case 0x00da: return((CHAR)(233 & 0xff));
  198.       case 0x00db: return((CHAR)(234 & 0xff));
  199.       case 0x00dc: return((CHAR)(154 & 0xff));
  200.       case 0x00dd: return((CHAR)(237 & 0xff));
  201.       case 0x00de: return((CHAR)(232 & 0xff));
  202.       case 0x00df: return((CHAR)(225 & 0xff));
  203.       case 0x00e0: return((CHAR)(133 & 0xff));
  204.       case 0x00e1: return((CHAR)(160 & 0xff));
  205.       case 0x00e2: return((CHAR)(131 & 0xff));
  206.       case 0x00e3: return((CHAR)(198 & 0xff));
  207.       case 0x00e4: return((CHAR)(132 & 0xff));
  208.       case 0x00e5: return((CHAR)(134 & 0xff));
  209.       case 0x00e6: return((CHAR)(145 & 0xff));
  210.       case 0x00e7: return((CHAR)(135 & 0xff));
  211.       case 0x00e8: return((CHAR)(138 & 0xff));
  212.       case 0x00e9: return((CHAR)(130 & 0xff));
  213.       case 0x00ea: return((CHAR)(136 & 0xff));
  214.       case 0x00eb: return((CHAR)(137 & 0xff));
  215.       case 0x00ec: return((CHAR)(141 & 0xff));
  216.       case 0x00ed: return((CHAR)(161 & 0xff));
  217.       case 0x00ee: return((CHAR)(140 & 0xff));
  218.       case 0x00ef: return((CHAR)(139 & 0xff));
  219.       case 0x00f0: return((CHAR)(208 & 0xff));
  220.       case 0x00f1: return((CHAR)(164 & 0xff));
  221.       case 0x00f2: return((CHAR)(149 & 0xff));
  222.       case 0x00f3: return((CHAR)(162 & 0xff));
  223.       case 0x00f4: return((CHAR)(147 & 0xff));
  224.       case 0x00f5: return((CHAR)(228 & 0xff));
  225.       case 0x00f6: return((CHAR)(148 & 0xff));
  226.       case 0x00f7: return((CHAR)(246 & 0xff));
  227.       case 0x00f8: return((CHAR)(155 & 0xff));
  228.       case 0x00f9: return((CHAR)(151 & 0xff));
  229.       case 0x00fa: return((CHAR)(163 & 0xff));
  230.       case 0x00fb: return((CHAR)(150 & 0xff));
  231.       case 0x00fc: return((CHAR)(129 & 0xff));
  232.       case 0x00fd: return((CHAR)(236 & 0xff));
  233.       case 0x00fe: return((CHAR)(231 & 0xff));
  234.       case 0x00ff: return((CHAR)(152 & 0xff));
  235.       case 0x20ac: return((CHAR)(213 & 0xff));
  236.       case 0x0192: return((CHAR)(159 & 0xff));
  237.       case 0x2017: return((CHAR)(242 & 0xff));
  238.       case 0x2500: return((CHAR)(196 & 0xff));
  239.       case 0x2502: return((CHAR)(179 & 0xff));
  240.       case 0x250c: return((CHAR)(218 & 0xff));
  241.       case 0x2510: return((CHAR)(191 & 0xff));
  242.       case 0x2514: return((CHAR)(192 & 0xff));
  243.       case 0x2518: return((CHAR)(217 & 0xff));
  244.       case 0x251c: return((CHAR)(195 & 0xff));
  245.       case 0x2524: return((CHAR)(180 & 0xff));
  246.       case 0x252c: return((CHAR)(194 & 0xff));
  247.       case 0x2534: return((CHAR)(193 & 0xff));
  248.       case 0x253c: return((CHAR)(197 & 0xff));
  249.       case 0x2550: return((CHAR)(205 & 0xff));
  250.       case 0x2551: return((CHAR)(186 & 0xff));
  251.       case 0x2554: return((CHAR)(201 & 0xff));
  252.       case 0x2557: return((CHAR)(187 & 0xff));
  253.       case 0x255a: return((CHAR)(200 & 0xff));
  254.       case 0x255d: return((CHAR)(188 & 0xff));
  255.       case 0x2560: return((CHAR)(204 & 0xff));
  256.       case 0x2563: return((CHAR)(185 & 0xff));
  257.       case 0x2566: return((CHAR)(203 & 0xff));
  258.       case 0x2569: return((CHAR)(202 & 0xff));
  259.       case 0x256c: return((CHAR)(206 & 0xff));
  260.       case 0x2580: return((CHAR)(223 & 0xff));
  261.       case 0x2584: return((CHAR)(220 & 0xff));
  262.       case 0x2588: return((CHAR)(219 & 0xff));
  263.       case 0x2591: return((CHAR)(176 & 0xff));
  264.       case 0x2592: return((CHAR)(177 & 0xff));
  265.       case 0x2593: return((CHAR)(178 & 0xff));
  266.       case 0x25a0: return((CHAR)(254 & 0xff));
  267.       default: return(tx_cpsub(c)); /* For box characters etc */
  268.     }
  269. }
  270. int /* Windows Code Page 1250 (Latin-2) */
  271. #ifdef CK_ANSIC
  272. tx_cp1250(USHORT c)
  273. #else
  274. tx_cp1250(c) USHORT c;
  275. #endif /* CK_ANSIC */
  276. {
  277.     if (c < 0x80 || c > 0xbf && c <= 0xff) /* Has C1 graphics */
  278.       return((CHAR)(c & 0xff));
  279.     switch (c) {
  280.       case 0x002D: return((CHAR)(0xad & 0xff));
  281.       case 0x00A0: return((CHAR)(0xa0 & 0xff));
  282.       case 0x00A4: return((CHAR)(0xa4 & 0xff));
  283.       case 0x00A6: return((CHAR)(0xa6 & 0xff));
  284.       case 0x00A7: return((CHAR)(0xa7 & 0xff));
  285.       case 0x00A8: return((CHAR)(0xa8 & 0xff));
  286.       case 0x00A9: return((CHAR)(0xa9 & 0xff));
  287.       case 0x00AB: return((CHAR)(0xab & 0xff));
  288.       case 0x00AC: return((CHAR)(0xac & 0xff));
  289.       case 0x00AE: return((CHAR)(0xae & 0xff));
  290.       case 0x00B0: return((CHAR)(0xb0 & 0xff));
  291.       case 0x00B1: return((CHAR)(0xb1 & 0xff));
  292.       case 0x00B4: return((CHAR)(0xb4 & 0xff));
  293.       case 0x00B5: return((CHAR)(0xb5 & 0xff));
  294.       case 0x00B6: return((CHAR)(0xb6 & 0xff));
  295.       case 0x00B7: return((CHAR)(0xb7 & 0xff));
  296.       case 0x00B8: return((CHAR)(0xb8 & 0xff));
  297.       case 0x00BB: return((CHAR)(0xbb & 0xff));
  298.       case 0x0104: return((CHAR)(0xa5 & 0xff));
  299.       case 0x0105: return((CHAR)(0xb9 & 0xff));
  300.       case 0x013D: return((CHAR)(0xbc & 0xff));
  301.       case 0x013E: return((CHAR)(0xbe & 0xff));
  302.       case 0x0141: return((CHAR)(0xa3 & 0xff));
  303.       case 0x0142: return((CHAR)(0xb3 & 0xff));
  304.       case 0x015A: return((CHAR)(0x8c & 0xff)); /* S acute */
  305.       case 0x015E: return((CHAR)(0xaa & 0xff));
  306.       case 0x015F: return((CHAR)(0xba & 0xff));
  307.       case 0x015b: return((CHAR)(0x9c & 0xff)); /* s acute */
  308.       case 0x0164: return((CHAR)(0x8d & 0xff)); /* T caron */
  309.       case 0x0165: return((CHAR)(0x9d & 0xff)); /* t caron */
  310.       case 0x0173: return((CHAR)(0x9e & 0xff)); /* z caron */
  311.       case 0x0179: return((CHAR)(0x8f & 0xff)); /* Z acute */
  312.       case 0x017A: return((CHAR)(0x9f & 0xff)); /* z acute */
  313.       case 0x017B: return((CHAR)(0xaf & 0xff));
  314.       case 0x017C: return((CHAR)(0xbf & 0xff));
  315.       case 0x017D: return((CHAR)(0x8e & 0xff)); /* Z caron */
  316.       case 0x02C7: return((CHAR)(0xa1 & 0xff));
  317.       case 0x02D8: return((CHAR)(0xa2 & 0xff));
  318.       case 0x02DB: return((CHAR)(0xb2 & 0xff));
  319.       case 0x02DD: return((CHAR)(0xbd & 0xff));
  320.       case 0x2010: case 0x2011: /* Hyphens */
  321. return((CHAR)(0x2d & 0xff));
  322.       case 0x2012: case 0x2013: /* en-dashes */
  323. return((CHAR)(0x96 & 0xff));
  324.       case 0x2014: case 0x2015: /* em-dashes */
  325. return((CHAR)(0x97 & 0xff));
  326.       case 0x2018: /* Various quotation marks... */
  327. return((CHAR)(0x91 & 0xff));
  328.       case 0x2019:
  329. return((CHAR)(0x92 & 0xff));
  330.       case 0x201c:
  331. return((CHAR)(0x93 & 0xff));
  332.       case 0x201d:
  333. return((CHAR)(0x94 & 0xff));
  334.       case 0x201e:
  335. return((CHAR)(0x84 & 0xff));
  336.       case 0x2020: /* Dagger */
  337. return((CHAR)(0x86 & 0xff));
  338.       case 0x2021: /* Double Dagger */
  339. return((CHAR)(0x87 & 0xff));
  340.       case 0x2022: /* Bullet */
  341. return((CHAR)(0x95 & 0xff));
  342.       case 0x2026: /* Ellipsis */
  343. return((CHAR)(0x85 & 0xff));
  344.       case 0x2030: /* Per mil */
  345. return((CHAR)(0x89 & 0xff));
  346.       case 0x20AC: /* Euro */
  347.           return((CHAR)(0x80 & 0xff));
  348.       case 0x2122: /* Trade Mark */
  349. return((CHAR)(0x99 & 0xff));
  350.       default: return(0x003f);
  351.     }
  352. }
  353. int /* Windows Code Page 1251 (Cyrillic) */
  354. #ifdef CK_ANSIC
  355. tx_cp1251(USHORT c)
  356. #else
  357. tx_cp1251(c) USHORT c;
  358. #endif /* CK_ANSIC */
  359. {
  360.     if (c < 0x80) /* Has C1 graphics */
  361.       return((CHAR)(c & 0xff));
  362.     /* This is simply the inverse of u_cp1251.map */
  363.     switch (c) {
  364.       case 0x003c: return((CHAR)(0x8b & 0xff));
  365.       case 0x003e: return((CHAR)(0x9b & 0xff));
  366.       case 0x007e: return((CHAR)(0x98 & 0xff));
  367.       case 0x00A0: return((CHAR)(0xa0 & 0xff));
  368.       case 0x00A4: return((CHAR)(0xa4 & 0xff));
  369.       case 0x00A6: return((CHAR)(0xa6 & 0xff));
  370.       case 0x00A7: return((CHAR)(0xa7 & 0xff));
  371.       case 0x00A9: return((CHAR)(0xa9 & 0xff));
  372.       case 0x00AB: return((CHAR)(0xab & 0xff));
  373.       case 0x00AC: return((CHAR)(0xac & 0xff));
  374.       case 0x00AD: return((CHAR)(0xad & 0xff));
  375.       case 0x00AE: return((CHAR)(0xae & 0xff));
  376.       case 0x00b0: return((CHAR)(0xb0 & 0xff));
  377.       case 0x00b1: return((CHAR)(0xb1 & 0xff));
  378.       case 0x00B5: return((CHAR)(0xb5 & 0xff));
  379.       case 0x00B6: return((CHAR)(0xb6 & 0xff));
  380.       case 0x00B7: return((CHAR)(0xb7 & 0xff));
  381.       case 0x00BB: return((CHAR)(0xbb & 0xff));
  382.       case 0x0401: return((CHAR)(0xa8 & 0xff));
  383.       case 0x0402: return((CHAR)(0x80 & 0xff));
  384.       case 0x0403: return((CHAR)(0x81 & 0xff));
  385.       case 0x0404: return((CHAR)(0xaa & 0xff));
  386.       case 0x0405: return((CHAR)(0xbd & 0xff));
  387.       case 0x0406: return((CHAR)(0xb2 & 0xff));
  388.       case 0x0407: return((CHAR)(0xaf & 0xff));
  389.       case 0x0408: return((CHAR)(0xa3 & 0xff));
  390.       case 0x0409: return((CHAR)(0x8a & 0xff));
  391.       case 0x040a: return((CHAR)(0x8c & 0xff));
  392.       case 0x040b: return((CHAR)(0x8e & 0xff));
  393.       case 0x040c: return((CHAR)(0x8d & 0xff));
  394.       case 0x040e: return((CHAR)(0xa1 & 0xff));
  395.       case 0x040f: return((CHAR)(0x8f & 0xff));
  396.       case 0x0410: return((CHAR)(0xc0 & 0xff));
  397.       case 0x0411: return((CHAR)(0xc1 & 0xff));
  398.       case 0x0412: return((CHAR)(0xc2 & 0xff));
  399.       case 0x0413: return((CHAR)(0xc3 & 0xff));
  400.       case 0x0414: return((CHAR)(0xc4 & 0xff));
  401.       case 0x0415: return((CHAR)(0xc5 & 0xff));
  402.       case 0x0416: return((CHAR)(0xc6 & 0xff));
  403.       case 0x0417: return((CHAR)(0xc7 & 0xff));
  404.       case 0x0418: return((CHAR)(0xc8 & 0xff));
  405.       case 0x0419: return((CHAR)(0xc9 & 0xff));
  406.       case 0x041a: return((CHAR)(0xca & 0xff));
  407.       case 0x041b: return((CHAR)(0xcb & 0xff));
  408.       case 0x041c: return((CHAR)(0xcc & 0xff));
  409.       case 0x041d: return((CHAR)(0xcd & 0xff));
  410.       case 0x041e: return((CHAR)(0xce & 0xff));
  411.       case 0x041f: return((CHAR)(0xcf & 0xff));
  412.       case 0x0420: return((CHAR)(0xd0 & 0xff));
  413.       case 0x0421: return((CHAR)(0xd1 & 0xff));
  414.       case 0x0422: return((CHAR)(0xd2 & 0xff));
  415.       case 0x0423: return((CHAR)(0xd3 & 0xff));
  416.       case 0x0424: return((CHAR)(0xd4 & 0xff));
  417.       case 0x0425: return((CHAR)(0xd5 & 0xff));
  418.       case 0x0426: return((CHAR)(0xd6 & 0xff));
  419.       case 0x0427: return((CHAR)(0xd7 & 0xff));
  420.       case 0x0428: return((CHAR)(0xd8 & 0xff));
  421.       case 0x0429: return((CHAR)(0xd9 & 0xff));
  422.       case 0x042a: return((CHAR)(0xda & 0xff));
  423.       case 0x042b: return((CHAR)(0xdb & 0xff));
  424.       case 0x042c: return((CHAR)(0xdc & 0xff));
  425.       case 0x042d: return((CHAR)(0xdd & 0xff));
  426.       case 0x042e: return((CHAR)(0xde & 0xff));
  427.       case 0x042f: return((CHAR)(0xdf & 0xff));
  428.       case 0x0430: return((CHAR)(0xe0 & 0xff));
  429.       case 0x0431: return((CHAR)(0xe1 & 0xff));
  430.       case 0x0432: return((CHAR)(0xe2 & 0xff));
  431.       case 0x0433: return((CHAR)(0xe3 & 0xff));
  432.       case 0x0434: return((CHAR)(0xe4 & 0xff));
  433.       case 0x0435: return((CHAR)(0xe5 & 0xff));
  434.       case 0x0436: return((CHAR)(0xe6 & 0xff));
  435.       case 0x0437: return((CHAR)(0xe7 & 0xff));
  436.       case 0x0438: return((CHAR)(0xe8 & 0xff));
  437.       case 0x0439: return((CHAR)(0xe9 & 0xff));
  438.       case 0x043a: return((CHAR)(0xea & 0xff));
  439.       case 0x043b: return((CHAR)(0xeb & 0xff));
  440.       case 0x043c: return((CHAR)(0xec & 0xff));
  441.       case 0x043d: return((CHAR)(0xed & 0xff));
  442.       case 0x043e: return((CHAR)(0xee & 0xff));
  443.       case 0x043f: return((CHAR)(0xef & 0xff));
  444.       case 0x0440: return((CHAR)(0xf0 & 0xff));
  445.       case 0x0441: return((CHAR)(0xf1 & 0xff));
  446.       case 0x0442: return((CHAR)(0xf2 & 0xff));
  447.       case 0x0443: return((CHAR)(0xf3 & 0xff));
  448.       case 0x0444: return((CHAR)(0xf4 & 0xff));
  449.       case 0x0445: return((CHAR)(0xf5 & 0xff));
  450.       case 0x0446: return((CHAR)(0xf6 & 0xff));
  451.       case 0x0447: return((CHAR)(0xf7 & 0xff));
  452.       case 0x0448: return((CHAR)(0xf8 & 0xff));
  453.       case 0x0449: return((CHAR)(0xf9 & 0xff));
  454.       case 0x044a: return((CHAR)(0xfa & 0xff));
  455.       case 0x044b: return((CHAR)(0xfb & 0xff));
  456.       case 0x044c: return((CHAR)(0xfc & 0xff));
  457.       case 0x044d: return((CHAR)(0xfd & 0xff));
  458.       case 0x044e: return((CHAR)(0xfe & 0xff));
  459.       case 0x044f: return((CHAR)(0xff & 0xff));
  460.       case 0x0451: return((CHAR)(0xb8 & 0xff));
  461.       case 0x0452: return((CHAR)(0x90 & 0xff));
  462.       case 0x0453: return((CHAR)(0x83 & 0xff));
  463.       case 0x0454: return((CHAR)(0xba & 0xff));
  464.       case 0x0455: return((CHAR)(0xbe & 0xff));
  465.       case 0x0456: return((CHAR)(0xb3 & 0xff));
  466.       case 0x0457: return((CHAR)(0xbf & 0xff));
  467.       case 0x0458: return((CHAR)(0xbc & 0xff));
  468.       case 0x0459: return((CHAR)(0x9a & 0xff));
  469.       case 0x045a: return((CHAR)(0x9c & 0xff));
  470.       case 0x045b: return((CHAR)(0x9e & 0xff));
  471.       case 0x045c: return((CHAR)(0x9d & 0xff));
  472.       case 0x045e: return((CHAR)(0xa2 & 0xff));
  473.       case 0x045f: return((CHAR)(0x9f & 0xff));
  474.       case 0x0490: return((CHAR)(0xa5 & 0xff));
  475.       case 0x0491: return((CHAR)(0xb4 & 0xff));
  476.       case 0x2012: return((CHAR)(0x96 & 0xff));
  477.       case 0x2014: return((CHAR)(0x97 & 0xff));
  478.       case 0x2018: return((CHAR)(0x91 & 0xff));
  479.       case 0x2019: return((CHAR)(0x92 & 0xff));
  480.       case 0x201a: return((CHAR)(0x82 & 0xff));
  481.       case 0x201c: return((CHAR)(0x93 & 0xff));
  482.       case 0x201d: return((CHAR)(0x94 & 0xff));
  483.       case 0x201e: return((CHAR)(0x84 & 0xff));
  484.       case 0x2020: return((CHAR)(0x86 & 0xff));
  485.       case 0x2021: return((CHAR)(0x87 & 0xff));
  486.       case 0x2022: return((CHAR)(0x95 & 0xff));
  487.       case 0x2026: return((CHAR)(0x85 & 0xff));
  488.       case 0x2031: return((CHAR)(0x89 & 0xff));
  489.       case 0x20AC: /* Euro */
  490.           return((CHAR)(0x88 & 0xff));
  491.       case 0x2116: return((CHAR)(0xb9 & 0xff));
  492.       case 0x2122: return((CHAR)(0x99 & 0xff));
  493.       default: return(0x003f);
  494.     }
  495. }
  496. int /* Unicode to Windows Code Page 1252 (Latin-1) */
  497. #ifdef CK_ANSIC
  498. tx_cp1252(USHORT c)
  499. #else
  500. tx_cp1252(c) USHORT c;
  501. #endif /* CK_ANSIC */
  502. {
  503.     if (c < 0x80 || c > 0x9f && c <= 0xff) /* Has C1 graphics */
  504.       return((CHAR)(c & 0xff));
  505.     switch (c) {
  506.       case 0x0152: /* OE */
  507. return((CHAR)(0x8c & 0xff));
  508.       case 0x0153: /* oe */
  509. return((CHAR)(0x9c & 0xff));
  510.       case 0x0160: /* S caron */
  511. return((CHAR)(0x8a & 0xff));
  512.       case 0x0161: /* s caron */
  513. return((CHAR)(0x9a & 0xff));
  514.       case 0x0178: /* Y diaeresis */
  515. return((CHAR)(0x9f & 0xff));
  516.       case 0x017D: /* Z caron */
  517. return((CHAR)(0x8e & 0xff));
  518.       case 0x017E: /* z caron */
  519. return((CHAR)(0x9e & 0xff));
  520.       case 0x0192: /* Florin */
  521. return((CHAR)(0x83 & 0xff));
  522.       case 0x2010: case 0x2011: /* Hyphens */
  523. return((CHAR)(0x2d & 0xff));
  524.       case 0x2012: case 0x2013: /* en-dashes */
  525. return((CHAR)(0x96 & 0xff));
  526.       case 0x2014: case 0x2015: /* em-dashes */
  527. return((CHAR)(0x97 & 0xff));
  528.       case 0x2018: /* Various quotation marks... */
  529. return((CHAR)(0x91 & 0xff));
  530.       case 0x2019:
  531.   return((CHAR)(0x92 & 0xff));
  532.       case 0x201c:
  533.   return((CHAR)(0x93 & 0xff));
  534.       case 0x201d:
  535.   return((CHAR)(0x94 & 0xff));
  536.       case 0x201e:
  537.   return((CHAR)(0x84 & 0xff));
  538.       case 0x2020: /* Dagger */
  539. return((CHAR)(0x86 & 0xff));
  540.       case 0x2021: /* Double Dagger */
  541. return((CHAR)(0x87 & 0xff));
  542.       case 0x2022: /* Bullet */
  543. return((CHAR)(0x95 & 0xff));
  544.       case 0x2026: /* Ellipsis */
  545. return((CHAR)(0x85 & 0xff));
  546.       case 0x2030: /* Per mil */
  547. return((CHAR)(0x89 & 0xff));
  548.       case 0x20AC: /* Euro */
  549.           return((CHAR)(0x80 & 0xff));
  550.       case 0x2122: /* Trade Mark */
  551. return((CHAR)(0x99 & 0xff));
  552.       default: return(0x003f);
  553.     }
  554. }
  555. int /* PC Code Page 852 */
  556. #ifdef CK_ANSIC
  557. tx_cp852(USHORT c)
  558. #else
  559. tx_cp852(c) USHORT c;
  560. #endif /* CK_ANSIC */
  561. {
  562.     if (c < 0x80) /* Has C1 graphics */
  563.       return((CHAR)(c & 0xff));
  564.     switch (c) {
  565.       case 0x00a0: return((CHAR)(255 & 0xff));
  566.       case 0x00a4: return((CHAR)(207 & 0xff));
  567.       case 0x00a7: return((CHAR)(245 & 0xff));
  568.       case 0x00a8: return((CHAR)(249 & 0xff));
  569.       case 0x00ab: return((CHAR)(174 & 0xff));
  570.       case 0x00ac: return((CHAR)(170 & 0xff));
  571.       case 0x00ad: return((CHAR)(240 & 0xff));
  572.       case 0x00b0: return((CHAR)(248 & 0xff));
  573.       case 0x00b4: return((CHAR)(239 & 0xff));
  574.       case 0x00b8: return((CHAR)(247 & 0xff));
  575.       case 0x00bb: return((CHAR)(175 & 0xff));
  576.       case 0x00c1: return((CHAR)(181 & 0xff));
  577.       case 0x00c2: return((CHAR)(182 & 0xff));
  578.       case 0x00c4: return((CHAR)(142 & 0xff));
  579.       case 0x00c7: return((CHAR)(128 & 0xff));
  580.       case 0x00c9: return((CHAR)(144 & 0xff));
  581.       case 0x00cb: return((CHAR)(211 & 0xff));
  582.       case 0x00cd: return((CHAR)(214 & 0xff));
  583.       case 0x00ce: return((CHAR)(215 & 0xff));
  584.       case 0x00d3: return((CHAR)(224 & 0xff));
  585.       case 0x00d4: return((CHAR)(226 & 0xff));
  586.       case 0x00d6: return((CHAR)(153 & 0xff));
  587.       case 0x00d7: return((CHAR)(158 & 0xff));
  588.       case 0x00da: return((CHAR)(233 & 0xff));
  589.       case 0x00dc: return((CHAR)(154 & 0xff));
  590.       case 0x00dd: return((CHAR)(237 & 0xff));
  591.       case 0x00df: return((CHAR)(225 & 0xff));
  592.       case 0x00e1: return((CHAR)(160 & 0xff));
  593.       case 0x00e2: return((CHAR)(131 & 0xff));
  594.       case 0x00e4: return((CHAR)(132 & 0xff));
  595.       case 0x00e7: return((CHAR)(135 & 0xff));
  596.       case 0x00e9: return((CHAR)(130 & 0xff));
  597.       case 0x00eb: return((CHAR)(137 & 0xff));
  598.       case 0x00ed: return((CHAR)(161 & 0xff));
  599.       case 0x00ee: return((CHAR)(140 & 0xff));
  600.       case 0x00f3: return((CHAR)(162 & 0xff));
  601.       case 0x00f4: return((CHAR)(147 & 0xff));
  602.       case 0x00f6: return((CHAR)(148 & 0xff));
  603.       case 0x00f7: return((CHAR)(246 & 0xff));
  604.       case 0x00fa: return((CHAR)(163 & 0xff));
  605.       case 0x00fc: return((CHAR)(129 & 0xff));
  606.       case 0x00fd: return((CHAR)(236 & 0xff));
  607.       case 0x0102: return((CHAR)(198 & 0xff));
  608.       case 0x0103: return((CHAR)(199 & 0xff));
  609.       case 0x0104: return((CHAR)(164 & 0xff));
  610.       case 0x0105: return((CHAR)(165 & 0xff));
  611.       case 0x0106: return((CHAR)(143 & 0xff));
  612.       case 0x0107: return((CHAR)(134 & 0xff));
  613.       case 0x010c: return((CHAR)(172 & 0xff));
  614.       case 0x010d: return((CHAR)(159 & 0xff));
  615.       case 0x010e: return((CHAR)(210 & 0xff));
  616.       case 0x010f: return((CHAR)(212 & 0xff));
  617.       case 0x0110: return((CHAR)(209 & 0xff));
  618.       case 0x0111: return((CHAR)(208 & 0xff));
  619.       case 0x0118: return((CHAR)(168 & 0xff));
  620.       case 0x0119: return((CHAR)(169 & 0xff));
  621.       case 0x011a: return((CHAR)(183 & 0xff));
  622.       case 0x011b: return((CHAR)(216 & 0xff));
  623.       case 0x0139: return((CHAR)(145 & 0xff));
  624.       case 0x013a: return((CHAR)(146 & 0xff));
  625.       case 0x013d: return((CHAR)(149 & 0xff));
  626.       case 0x013e: return((CHAR)(150 & 0xff));
  627.       case 0x0141: return((CHAR)(157 & 0xff));
  628.       case 0x0142: return((CHAR)(136 & 0xff));
  629.       case 0x0143: return((CHAR)(227 & 0xff));
  630.       case 0x0144: return((CHAR)(228 & 0xff));
  631.       case 0x0147: return((CHAR)(213 & 0xff));
  632.       case 0x0148: return((CHAR)(229 & 0xff));
  633.       case 0x0150: return((CHAR)(138 & 0xff));
  634.       case 0x0151: return((CHAR)(139 & 0xff));
  635.       case 0x0154: return((CHAR)(232 & 0xff));
  636.       case 0x0155: return((CHAR)(234 & 0xff));
  637.       case 0x0158: return((CHAR)(252 & 0xff));
  638.       case 0x0159: return((CHAR)(253 & 0xff));
  639.       case 0x015a: return((CHAR)(151 & 0xff));
  640.       case 0x015b: return((CHAR)(152 & 0xff));
  641.       case 0x015e: return((CHAR)(184 & 0xff));
  642.       case 0x015f: return((CHAR)(173 & 0xff));
  643.       case 0x0160: return((CHAR)(230 & 0xff));
  644.       case 0x0161: return((CHAR)(231 & 0xff));
  645.       case 0x0162: return((CHAR)(221 & 0xff));
  646.       case 0x0163: return((CHAR)(238 & 0xff));
  647.       case 0x0164: return((CHAR)(155 & 0xff));
  648.       case 0x0165: return((CHAR)(156 & 0xff));
  649.       case 0x016e: return((CHAR)(222 & 0xff));
  650.       case 0x016f: return((CHAR)(133 & 0xff));
  651.       case 0x0170: return((CHAR)(235 & 0xff));
  652.       case 0x0171: return((CHAR)(251 & 0xff));
  653.       case 0x0179: return((CHAR)(141 & 0xff));
  654.       case 0x017a: return((CHAR)(171 & 0xff));
  655.       case 0x017b: return((CHAR)(189 & 0xff));
  656.       case 0x017c: return((CHAR)(190 & 0xff));
  657.       case 0x017d: return((CHAR)(166 & 0xff));
  658.       case 0x017e: return((CHAR)(167 & 0xff));
  659.       case 0x02c7: return((CHAR)(243 & 0xff));
  660.       case 0x02d8: return((CHAR)(244 & 0xff));
  661.       case 0x02d9: return((CHAR)(250 & 0xff));
  662.       case 0x02db: return((CHAR)(242 & 0xff));
  663.       case 0x02dd: return((CHAR)(241 & 0xff));
  664.       case 0x2500: return((CHAR)(196 & 0xff));
  665.       case 0x2502: return((CHAR)(179 & 0xff));
  666.       case 0x250c: return((CHAR)(218 & 0xff));
  667.       case 0x2510: return((CHAR)(191 & 0xff));
  668.       case 0x2514: return((CHAR)(192 & 0xff));
  669.       case 0x2518: return((CHAR)(217 & 0xff));
  670.       case 0x251c: return((CHAR)(195 & 0xff));
  671.       case 0x2524: return((CHAR)(180 & 0xff));
  672.       case 0x252c: return((CHAR)(194 & 0xff));
  673.       case 0x2534: return((CHAR)(193 & 0xff));
  674.       case 0x253c: return((CHAR)(197 & 0xff));
  675.       case 0x2550: return((CHAR)(205 & 0xff));
  676.       case 0x2551: return((CHAR)(186 & 0xff));
  677.       case 0x2554: return((CHAR)(201 & 0xff));
  678.       case 0x2557: return((CHAR)(187 & 0xff));
  679.       case 0x255a: return((CHAR)(200 & 0xff));
  680.       case 0x255d: return((CHAR)(188 & 0xff));
  681.       case 0x2560: return((CHAR)(204 & 0xff));
  682.       case 0x2563: return((CHAR)(185 & 0xff));
  683.       case 0x2566: return((CHAR)(203 & 0xff));
  684.       case 0x2569: return((CHAR)(202 & 0xff));
  685.       case 0x256c: return((CHAR)(206 & 0xff));
  686.       case 0x2580: return((CHAR)(223 & 0xff));
  687.       case 0x2584: return((CHAR)(220 & 0xff));
  688.       case 0x2588: return((CHAR)(219 & 0xff));
  689.       case 0x2591: return((CHAR)(176 & 0xff));
  690.       case 0x2592: return((CHAR)(177 & 0xff));
  691.       case 0x2593: return((CHAR)(178 & 0xff));
  692.       case 0x25a0: return((CHAR)(254 & 0xff));
  693.       default: return(tx_cpsub(c)); /* For box characters etc */
  694.     }
  695. }
  696. int /* Windows Code Page 1253 (Greek) */
  697. #ifdef CK_ANSIC
  698. tx_cp1253(USHORT c)
  699. #else
  700. tx_cp1253(c) USHORT c;
  701. #endif /* CK_ANSIC */
  702. {
  703.     if (c < 0x80) /* Has C1 graphics */
  704.       return((CHAR)(c & 0xff));
  705.     switch (c) {
  706.       case 0x003c: return((CHAR)(0x8b & 0xff));
  707.       case 0x003e: return((CHAR)(0x9b & 0xff));
  708.       case 0x00A0: return((CHAR)(0xa0 & 0xff));
  709.       case 0x00A3: return((CHAR)(0xa3 & 0xff));
  710.       case 0x00A4: return((CHAR)(0xa4 & 0xff));
  711.       case 0x00A5: return((CHAR)(0xa5 & 0xff));
  712.       case 0x00A6: return((CHAR)(0xa6 & 0xff));
  713.       case 0x00A7: return((CHAR)(0xa7 & 0xff));
  714.       case 0x00A8: return((CHAR)(0xa8 & 0xff));
  715.       case 0x00A9: return((CHAR)(0xa9 & 0xff));
  716.       case 0x00AA: return((CHAR)(0xaa & 0xff));
  717.       case 0x00AB: return((CHAR)(0xab & 0xff));
  718.       case 0x00AC: return((CHAR)(0xac & 0xff));
  719.       case 0x00AD: return((CHAR)(0xad & 0xff));
  720.       case 0x00AE: return((CHAR)(0xae & 0xff));
  721.       case 0x00AF: return((CHAR)(0xaf & 0xff));
  722.       case 0x00B0: return((CHAR)(0xb0 & 0xff));
  723.       case 0x00B1: return((CHAR)(0xb1 & 0xff));
  724.       case 0x00B2: return((CHAR)(0xb2 & 0xff));
  725.       case 0x00B3: return((CHAR)(0xb3 & 0xff));
  726.       case 0x00B5: return((CHAR)(0xb5 & 0xff));
  727.       case 0x00B6: return((CHAR)(0xb6 & 0xff));
  728.       case 0x00b7: return((CHAR)(0xa1 & 0xff));
  729.       case 0x00BB: return((CHAR)(0xbb & 0xff));
  730.       case 0x00BD: return((CHAR)(0xbd & 0xff));
  731.       case 0x0192: return((CHAR)(0x83 & 0xff));
  732.       case 0x0386: return((CHAR)(0xa2 & 0xff));
  733.       case 0x0388: return((CHAR)(0xb8 & 0xff));
  734.       case 0x0389: return((CHAR)(0xb9 & 0xff));
  735.       case 0x038A: return((CHAR)(0xba & 0xff));
  736.       case 0x038C: return((CHAR)(0xbc & 0xff));
  737.       case 0x038E: return((CHAR)(0xbe & 0xff));
  738.       case 0x038F: return((CHAR)(0xbf & 0xff));
  739.       case 0x0390: return((CHAR)(0xc0 & 0xff));
  740.       case 0x0391: return((CHAR)(0xc1 & 0xff));
  741.       case 0x0392: return((CHAR)(0xc2 & 0xff));
  742.       case 0x0393: return((CHAR)(0xc3 & 0xff));
  743.       case 0x0394: return((CHAR)(0xc4 & 0xff));
  744.       case 0x0395: return((CHAR)(0xc5 & 0xff));
  745.       case 0x0396: return((CHAR)(0xc6 & 0xff));
  746.       case 0x0397: return((CHAR)(0xc7 & 0xff));
  747.       case 0x0398: return((CHAR)(0xc8 & 0xff));
  748.       case 0x0399: return((CHAR)(0xc9 & 0xff));
  749.       case 0x039A: return((CHAR)(0xca & 0xff));
  750.       case 0x039B: return((CHAR)(0xcb & 0xff));
  751.       case 0x039C: return((CHAR)(0xcc & 0xff));
  752.       case 0x039D: return((CHAR)(0xcd & 0xff));
  753.       case 0x039E: return((CHAR)(0xce & 0xff));
  754.       case 0x039F: return((CHAR)(0xcf & 0xff));
  755.       case 0x03a0: return((CHAR)(0xd0 & 0xff));
  756.       case 0x03a1: return((CHAR)(0xd1 & 0xff));
  757.       case 0x03a3: return((CHAR)(0xd3 & 0xff));
  758.       case 0x03a4: return((CHAR)(0xd4 & 0xff));
  759.       case 0x03a5: return((CHAR)(0xd5 & 0xff));
  760.       case 0x03a6: return((CHAR)(0xd6 & 0xff));
  761.       case 0x03a7: return((CHAR)(0xd7 & 0xff));
  762.       case 0x03a8: return((CHAR)(0xd8 & 0xff));
  763.       case 0x03a9: return((CHAR)(0xd9 & 0xff));
  764.       case 0x03aA: return((CHAR)(0xda & 0xff));
  765.       case 0x03aB: return((CHAR)(0xdb & 0xff));
  766.       case 0x03aC: return((CHAR)(0xdc & 0xff));
  767.       case 0x03aD: return((CHAR)(0xdd & 0xff));
  768.       case 0x03aE: return((CHAR)(0xde & 0xff));
  769.       case 0x03aF: return((CHAR)(0xdf & 0xff));
  770.       case 0x03b0: return((CHAR)(0xe0 & 0xff));
  771.       case 0x03b1: return((CHAR)(0xe1 & 0xff));
  772.       case 0x03b2: return((CHAR)(0xe2 & 0xff));
  773.       case 0x03b3: return((CHAR)(0xe3 & 0xff));
  774.       case 0x03b4: return((CHAR)(0xe4 & 0xff));
  775.       case 0x03b5: return((CHAR)(0xe5 & 0xff));
  776.       case 0x03b6: return((CHAR)(0xe6 & 0xff));
  777.       case 0x03b7: return((CHAR)(0xe7 & 0xff));
  778.       case 0x03b8: return((CHAR)(0xe8 & 0xff));
  779.       case 0x03b9: return((CHAR)(0xe9 & 0xff));
  780.       case 0x03bA: return((CHAR)(0xea & 0xff));
  781.       case 0x03bB: return((CHAR)(0xeb & 0xff));
  782.       case 0x03bC: return((CHAR)(0xec & 0xff));
  783.       case 0x03bD: return((CHAR)(0xed & 0xff));
  784.       case 0x03bE: return((CHAR)(0xee & 0xff));
  785.       case 0x03bF: return((CHAR)(0xef & 0xff));
  786.       case 0x03c0: return((CHAR)(0xf0 & 0xff));
  787.       case 0x03c1: return((CHAR)(0xf1 & 0xff));
  788.       case 0x03c2: return((CHAR)(0xf2 & 0xff));
  789.       case 0x03c3: return((CHAR)(0xf3 & 0xff));
  790.       case 0x03c4: return((CHAR)(0xf4 & 0xff));
  791.       case 0x03c5: return((CHAR)(0xf5 & 0xff));
  792.       case 0x03c6: return((CHAR)(0xf6 & 0xff));
  793.       case 0x03c7: return((CHAR)(0xf7 & 0xff));
  794.       case 0x03c8: return((CHAR)(0xf8 & 0xff));
  795.       case 0x03c9: return((CHAR)(0xf9 & 0xff));
  796.       case 0x03cA: return((CHAR)(0xfa & 0xff));
  797.       case 0x03cB: return((CHAR)(0xfb & 0xff));
  798.       case 0x03cC: return((CHAR)(0xfc & 0xff));
  799.       case 0x03cD: return((CHAR)(0xfd & 0xff));
  800.       case 0x03cE: return((CHAR)(0xfe & 0xff));
  801.       case 0x2012: return((CHAR)(0x96 & 0xff));
  802.       case 0x2014: return((CHAR)(0x97 & 0xff));
  803.       case 0x2018: return((CHAR)(0x91 & 0xff));
  804.       case 0x2019: return((CHAR)(0x92 & 0xff));
  805.       case 0x201a: return((CHAR)(0x82 & 0xff));
  806.       case 0x201c: return((CHAR)(0x93 & 0xff));
  807.       case 0x201d: return((CHAR)(0x94 & 0xff));
  808.       case 0x201e: return((CHAR)(0x84 & 0xff));
  809.       case 0x2020: return((CHAR)(0x86 & 0xff));
  810.       case 0x2021: return((CHAR)(0x87 & 0xff));
  811.       case 0x2022: return((CHAR)(0x95 & 0xff));
  812.       case 0x2026: return((CHAR)(0x85 & 0xff));
  813.       case 0x2031: return((CHAR)(0x89 & 0xff));
  814.       case 0x20AC: /* Euro */
  815.           return((CHAR)(0x80 & 0xff));
  816.       case 0x2122: return((CHAR)(0x99 & 0xff));
  817.       default: return(0x003f);
  818.     }
  819. }
  820. int /* Windows Code Page 1254 (Turkish) */
  821. #ifdef CK_ANSIC
  822. tx_cp1254(USHORT c)
  823. #else
  824. tx_cp1254(c) USHORT c;
  825. #endif /* CK_ANSIC */
  826. {
  827.     if (c < 0x80)
  828.       return((CHAR)(c & 0xff));
  829.     switch (c) {
  830.       case 0x011e: return((CHAR)(0xd0 & 0xff)); /* G breve    */
  831.       case 0x0130: return((CHAR)(0xdd & 0xff)); /* I with dot */
  832.       case 0x015e: return((CHAR)(0xde & 0xff)); /* S cedilla  */
  833.       case 0x011f: return((CHAR)(0xf0 & 0xff)); /* g breve    */
  834.       case 0x0131: return((CHAR)(0xfd & 0xff)); /* i dotless */
  835.       case 0x015f: return((CHAR)(0xfe & 0xff)); /* s cedilla */
  836.       default: return(tx_cp1252(c)); /* The rest is like Windows Latin-1 */
  837.     }
  838. }
  839. int
  840. #ifdef CK_ANSIC
  841. tx_cp1255(USHORT c)
  842. #else
  843. tx_cp1255(c) USHORT c;
  844. #endif /* CK_ANSIC */
  845. {
  846.     if (c < 0x080)
  847.         return((CHAR)(c & 0xff));
  848.     switch (c) {
  849.       case 0x20AC:
  850. return((CHAR)(0x80 & 0xff)); /* EURO SIGN */
  851.       case 0x201A:
  852. return((CHAR)(0x82 & 0xff)); /* SINGLE LOW-9 QUOTATION MARK */
  853.       case 0x0192:
  854. return((CHAR)(0x83 & 0xff)); /* LATIN SMALL LETTER F WITH HOOK */
  855.       case 0x201E:
  856. return((CHAR)(0x84 & 0xff)); /* DOUBLE LOW-9 QUOTATION MARK */
  857.       case 0x2026:
  858. return((CHAR)(0x85 & 0xff)); /* HORIZONTAL ELLIPSIS */
  859.       case 0x2020:
  860. return((CHAR)(0x86 & 0xff)); /* DAGGER */
  861.       case 0x2021:
  862. return((CHAR)(0x87 & 0xff)); /* DOUBLE DAGGER */
  863.       case 0x02C6:
  864. return((CHAR)(0x88 & 0xff)); /* MODIFIER LETTER CIRCUMFLEX ACCENT */
  865.       case 0x2030:
  866. return((CHAR)(0x89 & 0xff)); /* PER MILLE SIGN */
  867.       case 0x2039:
  868. return((CHAR)(0x8B & 0xff)); /* SINGLE LEFT-POINTING ANGLE QUOTE */
  869.       case 0x2018:
  870. return((CHAR)(0x91 & 0xff)); /* LEFT SINGLE QUOTATION MARK */
  871.       case 0x2019:
  872. return((CHAR)(0x92 & 0xff)); /* RIGHT SINGLE QUOTATION MARK */
  873.       case 0x201C:
  874. return((CHAR)(0x93 & 0xff)); /* LEFT DOUBLE QUOTATION MARK */
  875.       case 0x201D:
  876. return((CHAR)(0x94 & 0xff)); /* RIGHT DOUBLE QUOTATION MARK */
  877.       case 0x2022:
  878. return((CHAR)(0x95 & 0xff)); /* BULLET */
  879.       case 0x2013:
  880. return((CHAR)(0x96 & 0xff)); /* EN DASH */
  881.       case 0x2014:
  882.         return((CHAR)(0x97 & 0xff)); /* EM DASH */
  883.       case 0x02DC:
  884.         return((CHAR)(0x98 & 0xff)); /* SMALL TILDE */
  885.       case 0x2122:
  886.         return((CHAR)(0x99 & 0xff)); /* TRADE MARK SIGN */
  887.       case 0x203A:
  888.         return((CHAR)(0x9B & 0xff)); /* SINGLE RIGHT-POINTING ANGLE QUOTE */
  889.       case 0x00A0:
  890.         return((CHAR)(0xA0 & 0xff)); /* NO-BREAK SPACE */
  891.       case 0x00A1:
  892.         return((CHAR)(0xA1 & 0xff)); /* INVERTED EXCLAMATION MARK */
  893.       case 0x00A2:
  894.         return((CHAR)(0xA2 & 0xff)); /* CENT SIGN */
  895.       case 0x00A3:
  896.         return((CHAR)(0xA3 & 0xff)); /* POUND SIGN */
  897.       case 0x20AA:
  898.         return((CHAR)(0xA4 & 0xff)); /* NEW SHEQEL SIGN */
  899.       case 0x00A5:
  900.         return((CHAR)(0xA5 & 0xff)); /* YEN SIGN */
  901.       case 0x00A6:
  902.         return((CHAR)(0xA6 & 0xff)); /* BROKEN BAR */
  903.       case 0x00A7:
  904.         return((CHAR)(0xA7 & 0xff)); /* SECTION SIGN */
  905.       case 0x00A8:
  906.         return((CHAR)(0xA8 & 0xff)); /* DIAERESIS */
  907.       case 0x00A9:
  908.         return((CHAR)(0xA9 & 0xff)); /* COPYRIGHT SIGN */
  909.       case 0x00D7:
  910.         return((CHAR)(0xAA & 0xff)); /* MULTIPLICATION SIGN */
  911.       case 0x00AB:
  912.         return((CHAR)(0xAB & 0xff)); /* LEFT-POINTING DOUBLE ANGLE QUOTE */
  913.       case 0x00AC:
  914.         return((CHAR)(0xAC & 0xff)); /* NOT SIGN */
  915.       case 0x00AD:
  916.         return((CHAR)(0xAD & 0xff)); /* SOFT HYPHEN */
  917.       case 0x00AE:
  918.         return((CHAR)(0xAE & 0xff)); /* REGISTERED SIGN */
  919.       case 0x00AF:
  920.         return((CHAR)(0xAF & 0xff)); /* MACRON */
  921.       case 0x00B0:
  922.         return((CHAR)(0xB0 & 0xff)); /* DEGREE SIGN */
  923.       case 0x00B1:
  924.         return((CHAR)(0xB1 & 0xff)); /* PLUS-MINUS SIGN */
  925.       case 0x00B2:
  926.         return((CHAR)(0xB2 & 0xff)); /* SUPERSCRIPT TWO */
  927.       case 0x00B3:
  928.         return((CHAR)(0xB3 & 0xff)); /* SUPERSCRIPT THREE */
  929.       case 0x00B4:
  930.         return((CHAR)(0xB4 & 0xff)); /* ACUTE ACCENT */
  931.       case 0x00B5:
  932.         return((CHAR)(0xB5 & 0xff)); /* MICRO SIGN */
  933.       case 0x00B6:
  934.         return((CHAR)(0xB6 & 0xff)); /* PILCROW SIGN */
  935.       case 0x00B7:
  936.         return((CHAR)(0xB7 & 0xff)); /* MIDDLE DOT */
  937.       case 0x00B8:
  938.         return((CHAR)(0xB8 & 0xff)); /* CEDILLA */
  939.       case 0x00B9:
  940.         return((CHAR)(0xB9 & 0xff)); /* SUPERSCRIPT ONE */
  941.       case 0x00F7:
  942.         return((CHAR)(0xBA & 0xff)); /* DIVISION SIGN */
  943.       case 0x00BB:
  944.         return((CHAR)(0xBB & 0xff)); /* RIGHT-POINTING DOUBLE ANGLE QUOTE */
  945.       case 0x00BC:
  946.         return((CHAR)(0xBC & 0xff)); /* VULGAR FRACTION ONE QUARTER */
  947.       case 0x00BD:
  948.         return((CHAR)(0xBD & 0xff)); /* VULGAR FRACTION ONE HALF */
  949.       case 0x00BE:
  950.         return((CHAR)(0xBE & 0xff)); /* VULGAR FRACTION THREE QUARTERS */
  951.       case 0x00BF:
  952.         return((CHAR)(0xBF & 0xff)); /* INVERTED QUESTION MARK */
  953.       case 0x05B0:
  954.         return((CHAR)(0xC0 & 0xff)); /* HEBREW POINT SHEVA */
  955.       case 0x05B1:
  956.         return((CHAR)(0xC1 & 0xff)); /* HEBREW POINT HATAF SEGOL */
  957.       case 0x05B2:
  958.         return((CHAR)(0xC2 & 0xff)); /* HEBREW POINT HATAF PATAH */
  959.       case 0x05B3:
  960.         return((CHAR)(0xC3 & 0xff)); /* HEBREW POINT HATAF QAMATS */
  961.       case 0x05B4:
  962.         return((CHAR)(0xC4 & 0xff)); /* HEBREW POINT HIRIQ */
  963.       case 0x05B5:
  964.         return((CHAR)(0xC5 & 0xff)); /* HEBREW POINT TSERE */
  965.       case 0x05B6:
  966.         return((CHAR)(0xC6 & 0xff)); /* HEBREW POINT SEGOL */
  967.       case 0x05B7:
  968.         return((CHAR)(0xC7 & 0xff)); /* HEBREW POINT PATAH */
  969.       case 0x05B8:
  970.         return((CHAR)(0xC8 & 0xff)); /* HEBREW POINT QAMATS */
  971.       case 0x05B9:
  972.         return((CHAR)(0xC9 & 0xff)); /* HEBREW POINT HOLAM */
  973.       case 0x05BB:
  974.         return((CHAR)(0xCB & 0xff)); /* HEBREW POINT QUBUTS */
  975.       case 0x05BC:
  976.         return((CHAR)(0xCC & 0xff)); /* HEBREW POINT DAGESH OR MAPIQ */
  977.       case 0x05BD:
  978.         return((CHAR)(0xCD & 0xff)); /* HEBREW POINT METEG */
  979.       case 0x05BE:
  980.         return((CHAR)(0xCE & 0xff)); /* HEBREW PUNCTUATION MAQAF */
  981.       case 0x05BF:
  982.         return((CHAR)(0xCF & 0xff)); /* HEBREW POINT RAFE */
  983.       case 0x05C0:
  984.         return((CHAR)(0xD0 & 0xff)); /* HEBREW PUNCTUATION PASEQ */
  985.       case 0x05C1:
  986.         return((CHAR)(0xD1 & 0xff)); /* HEBREW POINT SHIN DOT */
  987.       case 0x05C2:
  988.         return((CHAR)(0xD2 & 0xff)); /* HEBREW POINT SIN DOT */
  989.       case 0x05C3:
  990.         return((CHAR)(0xD3 & 0xff)); /* HEBREW PUNCTUATION SOF PASUQ */
  991.       case 0x05F0:
  992.         return((CHAR)(0xD4 & 0xff)); /* HEBREW LIG. YIDDISH DOUBLE VAV */
  993.       case 0x05F1:
  994.         return((CHAR)(0xD5 & 0xff)); /* HEBREW LIGATURE YIDDISH VAV YOD */
  995.       case 0x05F2:
  996.         return((CHAR)(0xD6 & 0xff)); /* HEBREW LIG. YIDDISH DOUBLE YOD */
  997.       case 0x05F3:
  998.         return((CHAR)(0xD7 & 0xff)); /* HEBREW PUNCTUATION GERESH */
  999.       case 0x05F4:
  1000.         return((CHAR)(0xD8 & 0xff)); /* HEBREW PUNCTUATION GERSHAYIM */
  1001.       case 0x05D0:
  1002.         return((CHAR)(0xE0 & 0xff)); /* HEBREW LETTER ALEF */
  1003.       case 0x05D1:
  1004.         return((CHAR)(0xE1 & 0xff)); /* HEBREW LETTER BET */
  1005.       case 0x05D2:
  1006.         return((CHAR)(0xE2 & 0xff)); /* HEBREW LETTER GIMEL */
  1007.       case 0x05D3:
  1008.         return((CHAR)(0xE3 & 0xff)); /* HEBREW LETTER DALET */
  1009.       case 0x05D4:
  1010.         return((CHAR)(0xE4 & 0xff)); /* HEBREW LETTER HE */
  1011.       case 0x05D5:
  1012.         return((CHAR)(0xE5 & 0xff)); /* HEBREW LETTER VAV */
  1013.       case 0x05D6:
  1014.         return((CHAR)(0xE6 & 0xff)); /* HEBREW LETTER ZAYIN */
  1015.       case 0x05D7:
  1016.         return((CHAR)(0xE7 & 0xff)); /* HEBREW LETTER HET */
  1017.       case 0x05D8:
  1018.         return((CHAR)(0xE8 & 0xff)); /* HEBREW LETTER TET */
  1019.       case 0x05D9:
  1020.         return((CHAR)(0xE9 & 0xff)); /* HEBREW LETTER YOD */
  1021.       case 0x05DA:
  1022.         return((CHAR)(0xEA & 0xff)); /* HEBREW LETTER FINAL KAF */
  1023.       case 0x05DB:
  1024.         return((CHAR)(0xEB & 0xff)); /* HEBREW LETTER KAF */
  1025.       case 0x05DC:
  1026.         return((CHAR)(0xEC & 0xff)); /* HEBREW LETTER LAMED */
  1027.       case 0x05DD:
  1028.         return((CHAR)(0xED & 0xff)); /* HEBREW LETTER FINAL MEM */
  1029.       case 0x05DE:
  1030.         return((CHAR)(0xEE & 0xff)); /* HEBREW LETTER MEM */
  1031.       case 0x05DF:
  1032.         return((CHAR)(0xEF & 0xff)); /* HEBREW LETTER FINAL NUN */
  1033.       case 0x05E0:
  1034.         return((CHAR)(0xF0 & 0xff)); /* HEBREW LETTER NUN */
  1035.       case 0x05E1:
  1036.         return((CHAR)(0xF1 & 0xff)); /* HEBREW LETTER SAMEKH */
  1037.       case 0x05E2:
  1038.         return((CHAR)(0xF2 & 0xff)); /* HEBREW LETTER AYIN */
  1039.       case 0x05E3:
  1040.         return((CHAR)(0xF3 & 0xff)); /* HEBREW LETTER FINAL PE */
  1041.       case 0x05E4:
  1042.         return((CHAR)(0xF4 & 0xff)); /* HEBREW LETTER PE */
  1043.       case 0x05E5:
  1044.         return((CHAR)(0xF5 & 0xff)); /* HEBREW LETTER FINAL TSADI */
  1045.       case 0x05E6:
  1046.         return((CHAR)(0xF6 & 0xff)); /* HEBREW LETTER TSADI */
  1047.       case 0x05E7:
  1048.         return((CHAR)(0xF7 & 0xff)); /* HEBREW LETTER QOF */
  1049.       case 0x05E8:
  1050.         return((CHAR)(0xF8 & 0xff)); /* HEBREW LETTER RESH */
  1051.       case 0x05E9:
  1052.         return((CHAR)(0xF9 & 0xff)); /* HEBREW LETTER SHIN */
  1053.       case 0x05EA:
  1054.         return((CHAR)(0xFA & 0xff)); /* HEBREW LETTER TAV */
  1055.       case 0x200E:
  1056.         return((CHAR)(0xFD & 0xff)); /* LEFT-TO-RIGHT MARK */
  1057.       case 0x200F:
  1058.         return((CHAR)(0xFE & 0xff)); /* RIGHT-TO-LEFT MARK */
  1059.       default: return(0x003f);
  1060.     }
  1061. }
  1062. int /* Windows Arabic */
  1063. #ifdef CK_ANSIC
  1064. tx_cp1256(USHORT c)
  1065. #else
  1066. tx_cp1256(c) USHORT c;
  1067. #endif /* CK_ANSIC */
  1068. {
  1069.     if (c < 0x80)
  1070.       return((CHAR)(c & 0xff));
  1071.     switch (c) {
  1072.       case 0x20AC:
  1073.         return((CHAR)(0x80 & 0xff)); /* EURO SIGN */
  1074.       case 0x067E:
  1075.         return((CHAR)(0x81 & 0xff)); /* ARABIC LETTER PEH */
  1076.       case 0x201A:
  1077.         return((CHAR)(0x82 & 0xff)); /* SINGLE LOW-9 QUOTATION MARK */
  1078.       case 0x0192:
  1079.         return((CHAR)(0x83 & 0xff)); /* LATIN SMALL LETTER F WITH HOOK */
  1080.       case 0x201E:
  1081.         return((CHAR)(0x84 & 0xff)); /* DOUBLE LOW-9 QUOTATION MARK */
  1082.       case 0x2026:
  1083.         return((CHAR)(0x85 & 0xff)); /* HORIZONTAL ELLIPSIS */
  1084.       case 0x2020:
  1085.         return((CHAR)(0x86 & 0xff)); /* DAGGER */
  1086.       case 0x2021:
  1087.         return((CHAR)(0x87 & 0xff)); /* DOUBLE DAGGER */
  1088.       case 0x02C6:
  1089.         return((CHAR)(0x88 & 0xff)); /* MODIFIER LETTER CIRCUMFLEX ACCENT */
  1090.       case 0x2030:
  1091.         return((CHAR)(0x89 & 0xff)); /* PER MILLE SIGN */
  1092.       case 0x2039:
  1093.         return((CHAR)(0x8B & 0xff)); /* SINGLE LEFT-POINTING ANGLE QUOTE */
  1094.       case 0x0152:
  1095.         return((CHAR)(0x8C & 0xff)); /* LATIN CAPITAL LIGATURE OE */
  1096.       case 0x0686:
  1097.         return((CHAR)(0x8D & 0xff)); /* ARABIC LETTER TCHEH */
  1098.       case 0x0698:
  1099.         return((CHAR)(0x8E & 0xff)); /* ARABIC LETTER JEH */
  1100.       case 0x06AF:
  1101.         return((CHAR)(0x90 & 0xff)); /* ARABIC LETTER GAF */
  1102.       case 0x2018:
  1103.         return((CHAR)(0x91 & 0xff)); /* LEFT SINGLE QUOTATION MARK */
  1104.       case 0x2019:
  1105.         return((CHAR)(0x92 & 0xff)); /* RIGHT SINGLE QUOTATION MARK */
  1106.       case 0x201C:
  1107.         return((CHAR)(0x93 & 0xff)); /* LEFT DOUBLE QUOTATION MARK */
  1108.       case 0x201D:
  1109.         return((CHAR)(0x94 & 0xff)); /* RIGHT DOUBLE QUOTATION MARK */
  1110.       case 0x2022:
  1111.         return((CHAR)(0x95 & 0xff)); /* BULLET */
  1112.       case 0x2013:
  1113.         return((CHAR)(0x96 & 0xff)); /* EN DASH */
  1114.       case 0x2014:
  1115.         return((CHAR)(0x97 & 0xff)); /* EM DASH */
  1116.       case 0x2122:
  1117.         return((CHAR)(0x99 & 0xff)); /* TRADE MARK SIGN */
  1118.       case 0x203A:
  1119.         return((CHAR)(0x9B & 0xff)); /* SINGLE RIGHT-POINTING ANGLE QUOTE */
  1120.       case 0x0153:
  1121.         return((CHAR)(0x9C & 0xff)); /* LATIN SMALL LIGATURE OE */
  1122.       case 0x200C:
  1123.         return((CHAR)(0x9D & 0xff)); /* ZERO WIDTH NON-JOINER */
  1124.       case 0x200D:
  1125.         return((CHAR)(0x9E & 0xff)); /* ZERO WIDTH JOINER */
  1126.       case 0x00A0:
  1127.         return((CHAR)(0xA0 & 0xff)); /* NO-BREAK SPACE */
  1128.       case 0x060C:
  1129.         return((CHAR)(0xA1 & 0xff)); /* ARABIC COMMA */
  1130.       case 0x00A2:
  1131.         return((CHAR)(0xA2 & 0xff)); /* CENT SIGN */
  1132.       case 0x00A3:
  1133.         return((CHAR)(0xA3 & 0xff)); /* POUND SIGN */
  1134.       case 0x00A4:
  1135.         return((CHAR)(0xA4 & 0xff)); /* CURRENCY SIGN */
  1136.       case 0x00A5:
  1137.         return((CHAR)(0xA5 & 0xff)); /* YEN SIGN */
  1138.       case 0x00A6:
  1139.         return((CHAR)(0xA6 & 0xff)); /* BROKEN BAR */
  1140.       case 0x00A7:
  1141.         return((CHAR)(0xA7 & 0xff)); /* SECTION SIGN */
  1142.       case 0x00A8:
  1143.         return((CHAR)(0xA8 & 0xff)); /* DIAERESIS */
  1144.       case 0x00A9:
  1145.         return((CHAR)(0xA9 & 0xff)); /* COPYRIGHT SIGN */
  1146.       case 0x00AB:
  1147.         return((CHAR)(0xAB & 0xff)); /* LEFT-POINTING DOUBLE ANGLE QUOTE */
  1148.       case 0x00AC:
  1149.         return((CHAR)(0xAC & 0xff)); /* NOT SIGN */
  1150.       case 0x00AD:
  1151.         return((CHAR)(0xAD & 0xff)); /* SOFT HYPHEN */
  1152.       case 0x00AE:
  1153.         return((CHAR)(0xAE & 0xff)); /* REGISTERED SIGN */
  1154.       case 0x00AF:
  1155.         return((CHAR)(0xAF & 0xff)); /* MACRON */
  1156.       case 0x00B0:
  1157.         return((CHAR)(0xB0 & 0xff)); /* DEGREE SIGN */
  1158.       case 0x00B1:
  1159.         return((CHAR)(0xB1 & 0xff)); /* PLUS-MINUS SIGN */
  1160.       case 0x00B2:
  1161.         return((CHAR)(0xB2 & 0xff)); /* SUPERSCRIPT TWO */
  1162.       case 0x00B3:
  1163.         return((CHAR)(0xB3 & 0xff)); /* SUPERSCRIPT THREE */
  1164.       case 0x00B4:
  1165.         return((CHAR)(0xB4 & 0xff)); /* ACUTE ACCENT */
  1166.       case 0x00B5:
  1167.         return((CHAR)(0xB5 & 0xff)); /* MICRO SIGN */
  1168.       case 0x00B6:
  1169.         return((CHAR)(0xB6 & 0xff)); /* PILCROW SIGN */
  1170.       case 0x00B7:
  1171.         return((CHAR)(0xB7 & 0xff)); /* MIDDLE DOT */
  1172.       case 0x00B8:
  1173.         return((CHAR)(0xB8 & 0xff)); /* CEDILLA */
  1174.       case 0x00B9:
  1175.         return((CHAR)(0xB9 & 0xff)); /* SUPERSCRIPT ONE */
  1176.       case 0x061B:
  1177.         return((CHAR)(0xBA & 0xff)); /* ARABIC SEMICOLON */
  1178.       case 0x00BB:
  1179.         return((CHAR)(0xBB & 0xff)); /* RIGHT-POINTING DOUBLE ANGLE QUOTE */
  1180.       case 0x00BC:
  1181.         return((CHAR)(0xBC & 0xff)); /* VULGAR FRACTION ONE QUARTER */
  1182.       case 0x00BD:
  1183.         return((CHAR)(0xBD & 0xff)); /* VULGAR FRACTION ONE HALF */
  1184.       case 0x00BE:
  1185.         return((CHAR)(0xBE & 0xff)); /* VULGAR FRACTION THREE QUARTERS */
  1186.       case 0x061F:
  1187.         return((CHAR)(0xBF & 0xff)); /* ARABIC QUESTION MARK */
  1188.       case 0x0621:
  1189.         return((CHAR)(0xC1 & 0xff)); /* ARABIC LETTER HAMZA */
  1190.       case 0x0622:
  1191.         return((CHAR)(0xC2 & 0xff)); /* ARABIC LTR. ALEF WITH MADDA ABOVE */
  1192.       case 0x0623:
  1193.         return((CHAR)(0xC3 & 0xff)); /* ARABIC LTR. ALEF WITH HAMZA ABOVE */
  1194.       case 0x0624:
  1195.         return((CHAR)(0xC4 & 0xff)); /* ARABIC LTR. WAW WITH HAMZA ABOVE */
  1196.       case 0x0625:
  1197.         return((CHAR)(0xC5 & 0xff)); /* ARABIC LTR. ALEF WITH HAMZA BELOW */
  1198.       case 0x0626:
  1199.         return((CHAR)(0xC6 & 0xff)); /* ARABIC LTR. YEH WITH HAMZA ABOVE */
  1200.       case 0x0627:
  1201.         return((CHAR)(0xC7 & 0xff)); /* ARABIC LTR. ALEF */
  1202.       case 0x0628:
  1203.         return((CHAR)(0xC8 & 0xff)); /* ARABIC LTR. BEH */
  1204.       case 0x0629:
  1205.         return((CHAR)(0xC9 & 0xff)); /* ARABIC LETTER TEH MARBUTA */
  1206.       case 0x062A:
  1207.         return((CHAR)(0xCA & 0xff)); /* ARABIC LETTER TEH */
  1208.       case 0x062B:
  1209.         return((CHAR)(0xCB & 0xff)); /* ARABIC LETTER THEH */
  1210.       case 0x062C:
  1211.         return((CHAR)(0xCC & 0xff)); /* ARABIC LETTER JEEM */
  1212.       case 0x062D:
  1213.         return((CHAR)(0xCD & 0xff)); /* ARABIC LETTER HAH */
  1214.       case 0x062E:
  1215.         return((CHAR)(0xCE & 0xff)); /* ARABIC LETTER KHAH */
  1216.       case 0x062F:
  1217.         return((CHAR)(0xCF & 0xff)); /* ARABIC LETTER DAL */
  1218.       case 0x0630:
  1219.         return((CHAR)(0xD0 & 0xff)); /* ARABIC LETTER THAL */
  1220.       case 0x0631:
  1221.         return((CHAR)(0xD1 & 0xff)); /* ARABIC LETTER REH */
  1222.       case 0x0632:
  1223.         return((CHAR)(0xD2 & 0xff)); /* ARABIC LETTER ZAIN */
  1224.       case 0x0633:
  1225.         return((CHAR)(0xD3 & 0xff)); /* ARABIC LETTER SEEN */
  1226.       case 0x0634:
  1227.         return((CHAR)(0xD4 & 0xff)); /* ARABIC LETTER SHEEN */
  1228.       case 0x0635:
  1229.         return((CHAR)(0xD5 & 0xff)); /* ARABIC LETTER SAD */
  1230.       case 0x0636:
  1231.         return((CHAR)(0xD6 & 0xff)); /* ARABIC LETTER DAD */
  1232.       case 0x00D7:
  1233.         return((CHAR)(0xD7 & 0xff)); /* MULTIPLICATION SIGN */
  1234.       case 0x0637:
  1235.         return((CHAR)(0xD8 & 0xff)); /* ARABIC LETTER TAH */
  1236.       case 0x0638:
  1237.         return((CHAR)(0xD9 & 0xff)); /* ARABIC LETTER ZAH */
  1238.       case 0x0639:
  1239.         return((CHAR)(0xDA & 0xff)); /* ARABIC LETTER AIN */
  1240.       case 0x063A:
  1241.         return((CHAR)(0xDB & 0xff)); /* ARABIC LETTER GHAIN */
  1242.       case 0x0640:
  1243.         return((CHAR)(0xDC & 0xff)); /* ARABIC TATWEEL */
  1244.       case 0x0641:
  1245.         return((CHAR)(0xDD & 0xff)); /* ARABIC LETTER FEH */
  1246.       case 0x0642:
  1247.         return((CHAR)(0xDE & 0xff)); /* ARABIC LETTER QAF */
  1248.       case 0x0643:
  1249.         return((CHAR)(0xDF & 0xff)); /* ARABIC LETTER KAF */
  1250.       case 0x00E0:
  1251.         return((CHAR)(0xE0 & 0xff)); /* LATIN SMALL LETTER A WITH GRAVE */
  1252.       case 0x0644:
  1253.         return((CHAR)(0xE1 & 0xff)); /* ARABIC LETTER LAM */
  1254.       case 0x00E2:
  1255.         return((CHAR)(0xE2 & 0xff)); /* SMALL LETTER A WITH CIRCUMFLEX */
  1256.       case 0x0645:
  1257.         return((CHAR)(0xE3 & 0xff)); /* ARABIC LETTER MEEM */
  1258.       case 0x0646:
  1259.         return((CHAR)(0xE4 & 0xff)); /* ARABIC LETTER NOON */
  1260.       case 0x0647:
  1261.         return((CHAR)(0xE5 & 0xff)); /* ARABIC LETTER HEH */
  1262.       case 0x0648:
  1263.         return((CHAR)(0xE6 & 0xff)); /* ARABIC LETTER WAW */
  1264.       case 0x00E7:
  1265.         return((CHAR)(0xE7 & 0xff)); /* LATIN SMALL LETTER C WITH CEDILLA */
  1266.       case 0x00E8:
  1267.         return((CHAR)(0xE8 & 0xff)); /* LATIN SMALL LETTER E WITH GRAVE */
  1268.       case 0x00E9:
  1269.         return((CHAR)(0xE9 & 0xff)); /* LATIN SMALL LETTER E WITH ACUTE */
  1270.       case 0x00EA:
  1271.         return((CHAR)(0xEA & 0xff)); /* SMALL LETTER E WITH CIRCUMFLEX */
  1272.       case 0x00EB:
  1273.         return((CHAR)(0xEB & 0xff)); /* SMALL LETTER E WITH DIAERESIS */
  1274.       case 0x0649:
  1275.         return((CHAR)(0xEC & 0xff)); /* ARABIC LETTER ALEF MAKSURA */
  1276.       case 0x064A:
  1277.         return((CHAR)(0xED & 0xff)); /* ARABIC LETTER YEH */
  1278.       case 0x00EE:
  1279.         return((CHAR)(0xEE & 0xff)); /* SMALL LETTER I WITH CIRCUMFLEX */
  1280.       case 0x00EF:
  1281.         return((CHAR)(0xEF & 0xff)); /* SMALL LETTER I WITH DIAERESIS */
  1282.       case 0x064B:
  1283.         return((CHAR)(0xF0 & 0xff)); /* ARABIC FATHATAN */
  1284.       case 0x064C:
  1285.         return((CHAR)(0xF1 & 0xff)); /* ARABIC DAMMATAN */
  1286.       case 0x064D:
  1287.         return((CHAR)(0xF2 & 0xff)); /* ARABIC KASRATAN */
  1288.       case 0x064E:
  1289.         return((CHAR)(0xF3 & 0xff)); /* ARABIC FATHA */
  1290.       case 0x00F4:
  1291.         return((CHAR)(0xF4 & 0xff)); /* SMALL LETTER O WITH CIRCUMFLEX */
  1292.       case 0x064F:
  1293.         return((CHAR)(0xF5 & 0xff)); /* ARABIC DAMMA */
  1294.       case 0x0650:
  1295.         return((CHAR)(0xF6 & 0xff)); /* ARABIC KASRA */
  1296.       case 0x00F7:
  1297.         return((CHAR)(0xF7 & 0xff)); /* DIVISION SIGN */
  1298.       case 0x0651:
  1299.         return((CHAR)(0xF8 & 0xff)); /* ARABIC SHADDA */
  1300.       case 0x00F9:
  1301.         return((CHAR)(0xF9 & 0xff)); /* LATIN SMALL LETTER U WITH GRAVE */
  1302.       case 0x0652:
  1303.         return((CHAR)(0xFA & 0xff)); /* ARABIC SUKUN */
  1304.       case 0x00FB:
  1305.         return((CHAR)(0xFB & 0xff)); /* SMALL LETTER U WITH CIRCUMFLEX */
  1306.       case 0x00FC:
  1307.         return((CHAR)(0xFC & 0xff)); /* SMALL LETTER U WITH DIAERESIS */
  1308.       case 0x200E:
  1309.         return((CHAR)(0xFD & 0xff)); /* LEFT-TO-RIGHT MARK */
  1310.       case 0x200F:
  1311.         return((CHAR)(0xFE & 0xff)); /* RIGHT-TO-LEFT MARK */
  1312.       default: return(0x003f);
  1313.     }
  1314. }
  1315. int /* Windows Code Page 1257 (Latin-4) */
  1316. #ifdef CK_ANSIC
  1317. tx_cp1257(USHORT c)
  1318. #else
  1319. tx_cp1257(c) USHORT c;
  1320. #endif /* CK_ANSIC */
  1321. {
  1322.     if (c < 0x80)
  1323.       return((CHAR)(c & 0xff));
  1324.     switch (c) {
  1325.       case 0x003c: return((CHAR)(0x8b & 0xff));
  1326.       case 0x003e: return((CHAR)(0x9b & 0xff));
  1327.       case 0x00A0: return((CHAR)(0xa0 & 0xff));
  1328.       case 0x00A2: return((CHAR)(0xa2 & 0xff));
  1329.       case 0x00A3: return((CHAR)(0xa3 & 0xff));
  1330.       case 0x00A4: return((CHAR)(0xa4 & 0xff));
  1331.       case 0x00A6: return((CHAR)(0xa6 & 0xff));
  1332.       case 0x00A7: return((CHAR)(0xa7 & 0xff));
  1333.       case 0x00A9: return((CHAR)(0xa9 & 0xff));
  1334.       case 0x00AB: return((CHAR)(0xab & 0xff));
  1335.       case 0x00AC: return((CHAR)(0xac & 0xff));
  1336.       case 0x00AD: return((CHAR)(0xad & 0xff));
  1337.       case 0x00AE: return((CHAR)(0xae & 0xff));
  1338.       case 0x00B0: return((CHAR)(0xb0 & 0xff));
  1339.       case 0x00B1: return((CHAR)(0xb1 & 0xff));
  1340.       case 0x00B2: return((CHAR)(0xb2 & 0xff));
  1341.       case 0x00B3: return((CHAR)(0xb3 & 0xff));
  1342.       case 0x00B5: return((CHAR)(0xb5 & 0xff));
  1343.       case 0x00B6: return((CHAR)(0xb6 & 0xff));
  1344.       case 0x00B7: return((CHAR)(0xb7 & 0xff));
  1345.       case 0x00B9: return((CHAR)(0xb9 & 0xff));
  1346.       case 0x00BB: return((CHAR)(0xbb & 0xff));
  1347.       case 0x00BC: return((CHAR)(0xbc & 0xff));
  1348.       case 0x00BD: return((CHAR)(0xbd & 0xff));
  1349.       case 0x00BE: return((CHAR)(0xbe & 0xff));
  1350.       case 0x00C4: return((CHAR)(0xc4 & 0xff));
  1351.       case 0x00C5: return((CHAR)(0xc5 & 0xff));
  1352.       case 0x00c6: return((CHAR)(0xaf & 0xff));
  1353.       case 0x00C9: return((CHAR)(0xc9 & 0xff));
  1354.       case 0x00d3: return((CHAR)(0xd3 & 0xff));
  1355.       case 0x00D5: return((CHAR)(0xd5 & 0xff));
  1356.       case 0x00D6: return((CHAR)(0xd6 & 0xff));
  1357.       case 0x00D7: return((CHAR)(0xd7 & 0xff));
  1358.       case 0x00d8: return((CHAR)(0xa8 & 0xff));
  1359.       case 0x00DC: return((CHAR)(0xdc & 0xff));
  1360.       case 0x00DF: return((CHAR)(0xdf & 0xff));
  1361.       case 0x00E4: return((CHAR)(0xe4 & 0xff));
  1362.       case 0x00E5: return((CHAR)(0xe5 & 0xff));
  1363.       case 0x00e6: return((CHAR)(0xbf & 0xff));
  1364.       case 0x00E9: return((CHAR)(0xe9 & 0xff));
  1365.       case 0x00f3: return((CHAR)(0xf3 & 0xff));
  1366.       case 0x00F5: return((CHAR)(0xf5 & 0xff));
  1367.       case 0x00F6: return((CHAR)(0xf6 & 0xff));
  1368.       case 0x00F7: return((CHAR)(0xf7 & 0xff));
  1369.       case 0x00f8: return((CHAR)(0xb8 & 0xff));
  1370.       case 0x00fc: return((CHAR)(0xfc & 0xff));
  1371.       case 0x0100: return((CHAR)(0xc2 & 0xff));
  1372.       case 0x0101: return((CHAR)(0xe2 & 0xff));
  1373.       case 0x0104: return((CHAR)(0xc0 & 0xff));
  1374.       case 0x0105: return((CHAR)(0xe0 & 0xff));
  1375.       case 0x0106: return((CHAR)(0xc3 & 0xff));
  1376.       case 0x0107: return((CHAR)(0xe3 & 0xff));
  1377.       case 0x010C: return((CHAR)(0xc8 & 0xff));
  1378.       case 0x010D: return((CHAR)(0xe8 & 0xff));
  1379.       case 0x0112: return((CHAR)(0xc7 & 0xff));
  1380.       case 0x0113: return((CHAR)(0xe7 & 0xff));
  1381.       case 0x0116: return((CHAR)(0xcb & 0xff));
  1382.       case 0x0117: return((CHAR)(0xeb & 0xff));
  1383.       case 0x0118: return((CHAR)(0xc6 & 0xff));
  1384.       case 0x0119: return((CHAR)(0xe6 & 0xff));
  1385.       case 0x0122: return((CHAR)(0xcc & 0xff));
  1386.       case 0x0123: return((CHAR)(0xec & 0xff));
  1387.       case 0x012a: return((CHAR)(0xce & 0xff));
  1388.       case 0x012b: return((CHAR)(0xee & 0xff));
  1389.       case 0x012e: return((CHAR)(0xc1 & 0xff));
  1390.       case 0x012f: return((CHAR)(0xe1 & 0xff));
  1391.       case 0x0136: return((CHAR)(0xcd & 0xff));
  1392.       case 0x0137: return((CHAR)(0xed & 0xff));
  1393.       case 0x013c: return((CHAR)(0xef & 0xff));
  1394.       case 0x0141: return((CHAR)(0xd9 & 0xff));
  1395.       case 0x0142: return((CHAR)(0xf9 & 0xff));
  1396.       case 0x0143: return((CHAR)(0xd1 & 0xff));
  1397.       case 0x0144: return((CHAR)(0xf1 & 0xff));
  1398.       case 0x0145: return((CHAR)(0xd2 & 0xff));
  1399.       case 0x0146: return((CHAR)(0xf2 & 0xff));
  1400.       case 0x014c: return((CHAR)(0xd4 & 0xff));
  1401.       case 0x014d: return((CHAR)(0xf4 & 0xff));
  1402.       case 0x0156: return((CHAR)(0xaa & 0xff));
  1403.       case 0x0157: return((CHAR)(0xba & 0xff));
  1404.       case 0x015A: return((CHAR)(0xda & 0xff));
  1405.       case 0x015b: return((CHAR)(0xfa & 0xff));
  1406.       case 0x0160: return((CHAR)(0xd0 & 0xff));
  1407.       case 0x0161: return((CHAR)(0xf0 & 0xff));
  1408.       case 0x016a: return((CHAR)(0xdb & 0xff));
  1409.       case 0x016b: return((CHAR)(0xfb & 0xff));
  1410.       case 0x0172: return((CHAR)(0xd8 & 0xff));
  1411.       case 0x0173: return((CHAR)(0xf8 & 0xff));
  1412.       case 0x0179: return((CHAR)(0xca & 0xff));
  1413.       case 0x017a: return((CHAR)(0xea & 0xff));
  1414.       case 0x017b: return((CHAR)(0xdd & 0xff));
  1415.       case 0x017c: return((CHAR)(0xfd & 0xff));
  1416.       case 0x017d: return((CHAR)(0xde & 0xff));
  1417.       case 0x017e: return((CHAR)(0xfe & 0xff));
  1418.       case 0x2012: return((CHAR)(0x96 & 0xff));
  1419.       case 0x2014: return((CHAR)(0x97 & 0xff));
  1420.       case 0x2018: return((CHAR)(0x91 & 0xff));
  1421.       case 0x2019: return((CHAR)(0x92 & 0xff));
  1422.       case 0x201a: return((CHAR)(0x82 & 0xff));
  1423.       case 0x201c: return((CHAR)(0x93 & 0xff));
  1424.       case 0x201d: return((CHAR)(0x94 & 0xff));
  1425.       case 0x201e: return((CHAR)(0x84 & 0xff));
  1426.       case 0x2020: return((CHAR)(0x86 & 0xff));
  1427.       case 0x2021: return((CHAR)(0x87 & 0xff));
  1428.       case 0x2022: return((CHAR)(0x95 & 0xff));
  1429.       case 0x2026: return((CHAR)(0x85 & 0xff));
  1430.       case 0x2031: return((CHAR)(0x89 & 0xff));
  1431.       case 0x20AC: /* Euro */
  1432.           return((CHAR)(0x80 & 0xff));
  1433.       case 0x2122: return((CHAR)(0x99 & 0xff));
  1434.       default: return(0x003f);
  1435.     }
  1436. }
  1437. int /* Windows Code Page 1258 (Viet Nam) */
  1438. #ifdef CK_ANSIC
  1439. tx_cp1258(USHORT c)
  1440. #else
  1441. tx_cp1258(c) USHORT c;
  1442. #endif /* CK_ANSIC */
  1443. {
  1444.     if (c < 0x80) /* Has C1 graphics */
  1445.       return((CHAR)(c & 0xff));
  1446.     switch (c) {
  1447.       case 0x20AC:
  1448. return((CHAR)(0x80 & 0xff)); /* EURO SIGN */
  1449.       case 0x201A:
  1450. return((CHAR)(0x82 & 0xff)); /* SINGLE LOW-9 QUOTATION MARK */
  1451.       case 0x0192:
  1452. return((CHAR)(0x83 & 0xff)); /* LATIN SMALL LETTER F WITH HOOK */
  1453.       case 0x201E:
  1454. return((CHAR)(0x84 & 0xff)); /* DOUBLE LOW-9 QUOTATION MARK */
  1455.       case 0x2026: return((CHAR)(0x85 & 0xff)); /* HORIZONTAL ELLIPSIS */
  1456.       case 0x2020: return((CHAR)(0x86 & 0xff)); /* DAGGER */
  1457.       case 0x2021: return((CHAR)(0x87 & 0xff)); /* DOUBLE DAGGER */
  1458.       case 0x02C6:
  1459. return((CHAR)(0x88 & 0xff)); /* MODIFIER LETTER CIRCUMFLEX ACCENT */
  1460.       case 0x2030: return((CHAR)(0x89 & 0xff)); /* PER MILLE SIGN */
  1461.       case 0x2039:
  1462. return((CHAR)(0x8B & 0xff)); /* SINGLE LEFT ANGLE QUOTATION MARK */
  1463.       case 0x0152: return((CHAR)(0x8C & 0xff)); /* LATIN CAPITAL LIGATURE OE */
  1464.       case 0x2018:
  1465. return((CHAR)(0x91 & 0xff)); /* LEFT SINGLE QUOTATION MARK */
  1466.       case 0x2019:
  1467. return((CHAR)(0x92 & 0xff)); /* RIGHT SINGLE QUOTATION MARK */
  1468.       case 0x201C:
  1469. return((CHAR)(0x93 & 0xff)); /* LEFT DOUBLE QUOTATION MARK */
  1470.       case 0x201D:
  1471. return((CHAR)(0x94 & 0xff)); /* RIGHT DOUBLE QUOTATION MARK */
  1472.       case 0x2022:
  1473. return((CHAR)(0x95 & 0xff)); /* BULLET */
  1474.       case 0x2013:
  1475. return((CHAR)(0x96 & 0xff)); /* EN DASH */
  1476.       case 0x2014:
  1477. return((CHAR)(0x97 & 0xff)); /* EM DASH */
  1478.       case 0x02DC:
  1479. return((CHAR)(0x98 & 0xff)); /* SMALL TILDE */
  1480.       case 0x2122:
  1481. return((CHAR)(0x99 & 0xff)); /* TRADE MARK SIGN */
  1482.       case 0x203A:
  1483. /* SINGLE RIGHT-POINTING ANGLE QUOTATION MAR K*/
  1484. return((CHAR)(0x9B & 0xff));
  1485.       case 0x0153:
  1486. return((CHAR)(0x9C & 0xff)); /* LATIN SMALL LIGATURE OE */
  1487.       case 0x0178:
  1488. /* LATIN CAPITAL LETTER Y WITH DIAERESIS */
  1489. return((CHAR)(0x9F & 0xff));
  1490.       case 0x00A0:
  1491. return((CHAR)(0xA0 & 0xff)); /* NO-BREAK SPACE */
  1492.       case 0x00A1:
  1493. return((CHAR)(0xA1 & 0xff)); /* INVERTED EXCLAMATION MARK */
  1494.       case 0x00A2:
  1495. return((CHAR)(0xA2 & 0xff)); /* CENT SIGN */
  1496.       case 0x00A3:
  1497. return((CHAR)(0xA3 & 0xff)); /* POUND SIGN */
  1498.       case 0x00A4:
  1499. return((CHAR)(0xA4 & 0xff)); /* CURRENCY SIGN */
  1500.       case 0x00A5:
  1501. return((CHAR)(0xA5 & 0xff)); /* YEN SIGN */
  1502.       case 0x00A6:
  1503. return((CHAR)(0xA6 & 0xff)); /* BROKEN BAR */
  1504.       case 0x00A7:
  1505. return((CHAR)(0xA7 & 0xff)); /* SECTION SIGN */
  1506.       case 0x00A8:
  1507. return((CHAR)(0xA8 & 0xff)); /* DIAERESIS */
  1508.       case 0x00A9:
  1509. return((CHAR)(0xA9 & 0xff)); /* COPYRIGHT SIGN */
  1510.       case 0x00AA:
  1511. return((CHAR)(0xAA & 0xff)); /* FEMININE ORDINAL INDICATOR */
  1512.       case 0x00AB:
  1513. /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */
  1514. return((CHAR)(0xAB & 0xff));
  1515.       case 0x00AC:
  1516. return((CHAR)(0xAC & 0xff)); /* NOT SIGN */
  1517.       case 0x00AD:
  1518. return((CHAR)(0xAD & 0xff)); /* SOFT HYPHEN */
  1519.       case 0x00AE:
  1520. return((CHAR)(0xAE & 0xff)); /* REGISTERED SIGN */
  1521.       case 0x00AF:
  1522. return((CHAR)(0xAF & 0xff)); /* MACRON */
  1523.       case 0x00B0:
  1524. return((CHAR)(0xB0 & 0xff)); /* DEGREE SIGN */
  1525.       case 0x00B1:
  1526. return((CHAR)(0xB1 & 0xff)); /* PLUS-MINUS SIGN */
  1527.       case 0x00B2:
  1528. return((CHAR)(0xB2 & 0xff)); /* SUPERSCRIPT TWO */
  1529.       case 0x00B3:
  1530. return((CHAR)(0xB3 & 0xff)); /* SUPERSCRIPT THREE */
  1531.       case 0x00B4:
  1532. return((CHAR)(0xB4 & 0xff)); /* ACUTE ACCENT */
  1533.       case 0x00B5:
  1534. return((CHAR)(0xB5 & 0xff)); /* MICRO SIGN */
  1535.       case 0x00B6:
  1536. return((CHAR)(0xB6 & 0xff)); /* PILCROW SIGN */
  1537.       case 0x00B7:
  1538. return((CHAR)(0xB7 & 0xff)); /* MIDDLE DOT */
  1539.       case 0x00B8:
  1540. return((CHAR)(0xB8 & 0xff)); /* CEDILLA */
  1541.       case 0x00B9:
  1542. return((CHAR)(0xB9 & 0xff)); /* SUPERSCRIPT ONE */
  1543.       case 0x00BA:
  1544. return((CHAR)(0xBA & 0xff)); /* MASCULINE ORDINAL INDICATOR */
  1545.       case 0x00BB:
  1546. /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MAR K*/
  1547. return((CHAR)(0xBB & 0xff));
  1548.       case 0x00BC:
  1549. return((CHAR)(0xBC & 0xff)); /* VULGAR FRACTION ONE QUARTER */
  1550.       case 0x00BD:
  1551. return((CHAR)(0xBD & 0xff)); /* VULGAR FRACTION ONE HALF */
  1552.       case 0x00BE:
  1553. return((CHAR)(0xBE & 0xff)); /* VULGAR FRACTION THREE QUARTERS */
  1554.       case 0x00BF:
  1555. return((CHAR)(0xBF & 0xff)); /* INVERTED QUESTION MARK */
  1556.       case 0x00C0:
  1557. return((CHAR)(0xC0 & 0xff)); /* LATIN CAPITAL LETTER A WITH GRAVE */
  1558.       case 0x00C1:
  1559. return((CHAR)(0xC1 & 0xff)); /* LATIN CAPITAL LETTER A WITH ACUTE */
  1560.       case 0x00C2:
  1561. return((CHAR)(0xC2 & 0xff)); /* A CIRCUMFLEX */
  1562.       case 0x0102:
  1563. return((CHAR)(0xC3 & 0xff)); /* LATIN CAPITAL LETTER A WITH BREVE */
  1564.       case 0x00C4:
  1565. return((CHAR)(0xC4 & 0xff)); /* A DIAERESIS */
  1566.       case 0x00C5:
  1567. return((CHAR)(0xC5 & 0xff)); /* A RING */
  1568.       case 0x00C6:
  1569. return((CHAR)(0xC6 & 0xff)); /* LATIN CAPITAL LETTER AE */
  1570.       case 0x00C7:
  1571. return((CHAR)(0xC7 & 0xff)); /* C CEDILLA */
  1572.       case 0x00C8:
  1573. return((CHAR)(0xC8 & 0xff)); /* E GRAVE */
  1574.       case 0x00C9:
  1575. return((CHAR)(0xC9 & 0xff)); /* LATIN CAPITAL LETTER E WITH ACUTE */
  1576.       case 0x00CA:
  1577. return((CHAR)(0xCA & 0xff)); /* E WITH CIRCUMFLEX */
  1578.       case 0x00CB:
  1579. return((CHAR)(0xCB & 0xff)); /* E WITH DIAERESIS */
  1580.       case 0x0300:
  1581. return((CHAR)(0xCC & 0xff)); /* COMBINING GRAVE ACCENT */
  1582.       case 0x00CD:
  1583. return((CHAR)(0xCD & 0xff)); /* I WITH ACUTE */
  1584.       case 0x00CE:
  1585. return((CHAR)(0xCE & 0xff)); /* I WITH CIRCUMFLEX */
  1586.       case 0x00CF:
  1587. return((CHAR)(0xCF & 0xff)); /* I WITH DIAERESIS */
  1588.       case 0x0110:
  1589. return((CHAR)(0xD0 & 0xff)); /* D WITH STROKE */
  1590.       case 0x00D1:
  1591. return((CHAR)(0xD1 & 0xff)); /* LATIN CAPITAL LETTER N WITH TILDE */
  1592.       case 0x0309:
  1593. return((CHAR)(0xD2 & 0xff)); /* COMBINING HOOK ABOVE */
  1594.       case 0x00D3:
  1595. return((CHAR)(0xD3 & 0xff)); /* LATIN CAPITAL LETTER O WITH ACUTE */
  1596.       case 0x00D4:
  1597. return((CHAR)(0xD4 & 0xff)); /* O WITH CIRCUMFLEX */
  1598.       case 0x01A0:
  1599. return((CHAR)(0xD5 & 0xff)); /* LATIN CAPITAL LETTER O WITH HORN */
  1600.       case 0x00D6:
  1601. return((CHAR)(0xD6 & 0xff)); /* O WITH DIAERESIS */
  1602.       case 0x00D7:
  1603. return((CHAR)(0xD7 & 0xff)); /* MULTIPLICATION SIGN */
  1604.       case 0x00D8:
  1605. return((CHAR)(0xD8 & 0xff)); /* O WITH STROKE */
  1606.       case 0x00D9:
  1607. return((CHAR)(0xD9 & 0xff)); /* LATIN CAPITAL LETTER U WITH GRAVE */
  1608.       case 0x00DA:
  1609. return((CHAR)(0xDA & 0xff)); /* LATIN CAPITAL LETTER U WITH ACUTE */
  1610.       case 0x00DB:
  1611. return((CHAR)(0xDB & 0xff)); /* U WITH CIRCUMFLEX */
  1612.       case 0x00DC:
  1613. return((CHAR)(0xDC & 0xff)); /* U WITH DIAERESIS */
  1614.       case 0x01AF:
  1615. return((CHAR)(0xDD & 0xff)); /* LATIN CAPITAL LETTER U WITH HORN */
  1616.       case 0x0303:
  1617. return((CHAR)(0xDE & 0xff)); /* COMBINING TILDE */
  1618.       case 0x00DF:
  1619. return((CHAR)(0xDF & 0xff)); /* LATIN SMALL LETTER SHARP S */
  1620.       case 0x00E0:
  1621. return((CHAR)(0xE0 & 0xff)); /* LATIN SMALL LETTER A WITH GRAVE */
  1622.       case 0x00E1:
  1623. return((CHAR)(0xE1 & 0xff)); /* LATIN SMALL LETTER A WITH ACUTE */
  1624.       case 0x00E2:
  1625. return((CHAR)(0xE2 & 0xff)); /* SMALL A WITH CIRCUMFLEX */
  1626.       case 0x0103:
  1627. return((CHAR)(0xE3 & 0xff)); /* LATIN SMALL LETTER A WITH BREVE */
  1628.       case 0x00E4:
  1629. return((CHAR)(0xE4 & 0xff)); /* SMALL A WITH DIAERESIS */
  1630.       case 0x00E5:
  1631. return((CHAR)(0xE5 & 0xff)); /* SMALL A WITH RING ABOVE */
  1632.       case 0x00E6:
  1633. return((CHAR)(0xE6 & 0xff)); /* LATIN SMALL LETTER AE */
  1634.       case 0x00E7:
  1635. return((CHAR)(0xE7 & 0xff)); /* LATIN SMALL LETTER C WITH CEDILLA */
  1636.       case 0x00E8:
  1637. return((CHAR)(0xE8 & 0xff)); /* LATIN SMALL LETTER E WITH GRAVE */
  1638.       case 0x00E9:
  1639. return((CHAR)(0xE9 & 0xff)); /* LATIN SMALL LETTER E WITH ACUTE */
  1640.       case 0x00EA:
  1641. return((CHAR)(0xEA & 0xff)); /* SMALL E WITH CIRCUMFLEX */
  1642.       case 0x00EB:
  1643. return((CHAR)(0xEB & 0xff)); /* SMALL E WITH DIAERESIS */
  1644.       case 0x0301:
  1645. return((CHAR)(0xEC & 0xff)); /* COMBINING ACUTE ACCENT */
  1646.       case 0x00ED:
  1647. return((CHAR)(0xED & 0xff)); /* LATIN SMALL LETTER I WITH ACUTE */
  1648.       case 0x00EE:
  1649. return((CHAR)(0xEE & 0xff)); /* SMALL I WITH CIRCUMFLEX */
  1650.       case 0x00EF:
  1651. return((CHAR)(0xEF & 0xff)); /* SMALL I WITH DIAERESIS */
  1652.       case 0x0111:
  1653. return((CHAR)(0xF0 & 0xff)); /* LATIN SMALL LETTER D WITH STROKE */
  1654.       case 0x00F1:
  1655. return((CHAR)(0xF1 & 0xff)); /* LATIN SMALL LETTER N WITH TILDE */
  1656.       case 0x0323:
  1657. return((CHAR)(0xF2 & 0xff)); /* COMBINING DOT BELOW */
  1658.       case 0x00F3:
  1659. return((CHAR)(0xF3 & 0xff)); /* LATIN SMALL LETTER O WITH ACUTE */
  1660.       case 0x00F4:
  1661. return((CHAR)(0xF4 & 0xff)); /* SMALL O WITH CIRCUMFLEX */
  1662.       case 0x01A1:
  1663. return((CHAR)(0xF5 & 0xff)); /* LATIN SMALL LETTER O WITH HORN */
  1664.       case 0x00F6:
  1665. return((CHAR)(0xF6 & 0xff)); /* SMALL O WITH DIAERESIS */
  1666.       case 0x00F7:
  1667. return((CHAR)(0xF7 & 0xff)); /* DIVISION SIGN */
  1668.       case 0x00F8:
  1669. return((CHAR)(0xF8 & 0xff)); /* LATIN SMALL LETTER O WITH STROKE */
  1670.       case 0x00F9:
  1671. return((CHAR)(0xF9 & 0xff)); /* LATIN SMALL LETTER U WITH GRAVE */
  1672.       case 0x00FA:
  1673. return((CHAR)(0xFA & 0xff)); /* LATIN SMALL LETTER U WITH ACUTE */
  1674.       case 0x00FB:
  1675. return((CHAR)(0xFB & 0xff)); /* SMALL U WITH CIRCUMFLEX */
  1676.       case 0x00FC:
  1677. return((CHAR)(0xFC & 0xff)); /* SMALL U WITH DIAERESIS */
  1678.       case 0x01B0:
  1679. return((CHAR)(0xFD & 0xff)); /* LATIN SMALL LETTER U WITH HORN */
  1680.       case 0x20AB:
  1681. return((CHAR)(0xFE & 0xff)); /* DONG SIGN */
  1682.       case 0x00FF:
  1683. return((CHAR)(0xFF & 0xff)); /* SMALL Y WITH DIAERESIS */
  1684.     default: return(0x003f);
  1685.   }
  1686. }
  1687. int /* Code Page 037 - EBCDIC (U.S.) */
  1688. #ifdef CK_ANSIC
  1689. tx_cp37(USHORT c)
  1690. #else
  1691. tx_cp37(c) USHORT c;
  1692. #endif /* CK_ANSIC */
  1693. {
  1694.     switch (c) {
  1695.       case 0x0000:
  1696. return((CHAR)(0x00 & 0xff)); /* NULL */
  1697.       case 0x0001:
  1698. return((CHAR)(0x01 & 0xff)); /* START OF HEADING */
  1699.       case 0x0002:
  1700. return((CHAR)(0x02 & 0xff)); /* START OF TEXT */
  1701.       case 0x0003:
  1702. return((CHAR)(0x03 & 0xff)); /* END OF TEXT */
  1703.       case 0x009C:
  1704. return((CHAR)(0x04 & 0xff)); /* CONTROL */
  1705.       case 0x0009:
  1706. return((CHAR)(0x05 & 0xff)); /* HORIZONTAL TABULATION */
  1707.       case 0x0086:
  1708. return((CHAR)(0x06 & 0xff)); /* CONTROL */
  1709.       case 0x007F:
  1710. return((CHAR)(0x07 & 0xff)); /* DELETE */
  1711.       case 0x0097:
  1712. return((CHAR)(0x08 & 0xff)); /* CONTROL */
  1713.       case 0x008D:
  1714. return((CHAR)(0x09 & 0xff)); /* CONTROL */
  1715.       case 0x008E:
  1716. return((CHAR)(0x0A & 0xff)); /* CONTROL */
  1717.       case 0x000B:
  1718. return((CHAR)(0x0B & 0xff)); /* VERTICAL TABULATION */
  1719.       case 0x000C:
  1720. return((CHAR)(0x0C & 0xff)); /* FORM FEED */
  1721.       case 0x000D:
  1722. return((CHAR)(0x0D & 0xff)); /* CARRIAGE RETURN */
  1723.       case 0x000E:
  1724. return((CHAR)(0x0E & 0xff)); /* SHIFT OUT */
  1725.       case 0x000F:
  1726. return((CHAR)(0x0F & 0xff)); /* SHIFT IN */
  1727.       case 0x0010:
  1728. return((CHAR)(0x10 & 0xff)); /* DATA LINK ESCAPE */
  1729.       case 0x0011:
  1730. return((CHAR)(0x11 & 0xff)); /* DEVICE CONTROL ONE */
  1731.       case 0x0012:
  1732. return((CHAR)(0x12 & 0xff)); /* DEVICE CONTROL TWO */
  1733.       case 0x0013:
  1734. return((CHAR)(0x13 & 0xff)); /* DEVICE CONTROL THREE */
  1735.       case 0x009D:
  1736. return((CHAR)(0x14 & 0xff)); /* CONTROL */
  1737.       case 0x0085:
  1738. return((CHAR)(0x15 & 0xff)); /* CONTROL */
  1739.       case 0x0008:
  1740. return((CHAR)(0x16 & 0xff)); /* BACKSPACE */
  1741.       case 0x0087:
  1742. return((CHAR)(0x17 & 0xff)); /* CONTROL */
  1743.       case 0x0018:
  1744. return((CHAR)(0x18 & 0xff)); /* CANCEL */
  1745.       case 0x0019:
  1746. return((CHAR)(0x19 & 0xff)); /* END OF MEDIUM */
  1747.       case 0x0092:
  1748. return((CHAR)(0x1A & 0xff)); /* CONTROL */
  1749.       case 0x008F:
  1750. return((CHAR)(0x1B & 0xff)); /* CONTROL */
  1751.       case 0x001C:
  1752. return((CHAR)(0x1C & 0xff)); /* FILE SEPARATOR */
  1753.       case 0x001D:
  1754. return((CHAR)(0x1D & 0xff)); /* GROUP SEPARATOR */
  1755.       case 0x001E:
  1756. return((CHAR)(0x1E & 0xff)); /* RECORD SEPARATOR */
  1757.       case 0x001F:
  1758. return((CHAR)(0x1F & 0xff)); /* UNIT SEPARATOR */
  1759.       case 0x0080:
  1760. return((CHAR)(0x20 & 0xff)); /* CONTROL */
  1761.       case 0x0081:
  1762. return((CHAR)(0x21 & 0xff)); /* CONTROL */
  1763.       case 0x0082:
  1764. return((CHAR)(0x22 & 0xff)); /* CONTROL */
  1765.       case 0x0083:
  1766. return((CHAR)(0x23 & 0xff)); /* CONTROL */
  1767.       case 0x0084:
  1768. return((CHAR)(0x24 & 0xff)); /* CONTROL */
  1769.       case 0x000A:
  1770. return((CHAR)(0x25 & 0xff)); /* LINE FEED */
  1771.       case 0x0017:
  1772. return((CHAR)(0x26 & 0xff)); /* END OF TRANSMISSION BLOCK */
  1773.       case 0x001B:
  1774. return((CHAR)(0x27 & 0xff)); /* ESCAPE */
  1775.       case 0x0088:
  1776. return((CHAR)(0x28 & 0xff)); /* CONTROL */
  1777.       case 0x0089:
  1778. return((CHAR)(0x29 & 0xff)); /* CONTROL */
  1779.       case 0x008A:
  1780. return((CHAR)(0x2A & 0xff)); /* CONTROL */
  1781.       case 0x008B:
  1782. return((CHAR)(0x2B & 0xff)); /* CONTROL */
  1783.       case 0x008C:
  1784. return((CHAR)(0x2C & 0xff)); /* CONTROL */
  1785.       case 0x0005:
  1786. return((CHAR)(0x2D & 0xff)); /* ENQUIRY */
  1787.       case 0x0006:
  1788. return((CHAR)(0x2E & 0xff)); /* ACKNOWLEDGE */
  1789.       case 0x0007:
  1790. return((CHAR)(0x2F & 0xff)); /* BELL */
  1791.       case 0x0090:
  1792. return((CHAR)(0x30 & 0xff)); /* CONTROL */
  1793.       case 0x0091:
  1794. return((CHAR)(0x31 & 0xff)); /* CONTROL */
  1795.       case 0x0016:
  1796. return((CHAR)(0x32 & 0xff)); /* SYNCHRONOUS IDLE */
  1797.       case 0x0093:
  1798. return((CHAR)(0x33 & 0xff)); /* CONTROL */
  1799.       case 0x0094:
  1800. return((CHAR)(0x34 & 0xff)); /* CONTROL */
  1801.       case 0x0095:
  1802. return((CHAR)(0x35 & 0xff)); /* CONTROL */
  1803.       case 0x0096:
  1804. return((CHAR)(0x36 & 0xff)); /* CONTROL */
  1805.       case 0x0004:
  1806. return((CHAR)(0x37 & 0xff)); /* END OF TRANSMISSION */
  1807.       case 0x0098:
  1808. return((CHAR)(0x38 & 0xff)); /* CONTROL */
  1809.       case 0x0099:
  1810. return((CHAR)(0x39 & 0xff)); /* CONTROL */
  1811.       case 0x009A:
  1812. return((CHAR)(0x3A & 0xff)); /* CONTROL */
  1813.       case 0x009B:
  1814. return((CHAR)(0x3B & 0xff)); /* CONTROL */
  1815.       case 0x0014:
  1816. return((CHAR)(0x3C & 0xff)); /* DEVICE CONTROL FOUR */
  1817.       case 0x0015:
  1818. return((CHAR)(0x3D & 0xff)); /* NEGATIVE ACKNOWLEDGE */
  1819.       case 0x009E:
  1820. return((CHAR)(0x3E & 0xff)); /* CONTROL */
  1821.       case 0x001A:
  1822. return((CHAR)(0x3F & 0xff)); /* SUBSTITUTE */
  1823.       case 0x0020:
  1824. return((CHAR)(0x40 & 0xff)); /* SPACE */
  1825.       case 0x00A0:
  1826. return((CHAR)(0x41 & 0xff)); /* NO-BREAK SPACE */
  1827.       case 0x00E2:
  1828. return((CHAR)(0x42 & 0xff)); /* SMALL LETTER A WITH CIRCUMFLEX */
  1829.       case 0x00E4:
  1830. return((CHAR)(0x43 & 0xff)); /* SMALL LETTER A WITH DIAERESIS */
  1831.       case 0x00E0:
  1832. return((CHAR)(0x44 & 0xff)); /* LATIN SMALL LETTER A WITH GRAVE */
  1833.       case 0x00E1:
  1834. return((CHAR)(0x45 & 0xff)); /* LATIN SMALL LETTER A WITH ACUTE */
  1835.       case 0x00E3:
  1836. return((CHAR)(0x46 & 0xff)); /* LATIN SMALL LETTER A WITH TILDE */
  1837.       case 0x00E5:
  1838. return((CHAR)(0x47 & 0xff)); /* SMALL LETTER A WITH RING ABOVE */
  1839.       case 0x00E7:
  1840. return((CHAR)(0x48 & 0xff)); /* LATIN SMALL LETTER C WITH CEDILLA */
  1841.       case 0x00F1:
  1842. return((CHAR)(0x49 & 0xff)); /* LATIN SMALL LETTER N WITH TILDE */
  1843.       case 0x00A2:
  1844. return((CHAR)(0x4A & 0xff)); /* CENT SIGN */
  1845.       case 0x002E:
  1846. return((CHAR)(0x4B & 0xff)); /* FULL STOP */
  1847.       case 0x003C:
  1848. return((CHAR)(0x4C & 0xff)); /* LESS-THAN SIGN */
  1849.       case 0x0028:
  1850. return((CHAR)(0x4D & 0xff)); /* LEFT PARENTHESIS */
  1851.       case 0x002B:
  1852. return((CHAR)(0x4E & 0xff)); /* PLUS SIGN */
  1853.       case 0x007C:
  1854. return((CHAR)(0x4F & 0xff)); /* VERTICAL LINE */
  1855.       case 0x0026:
  1856. return((CHAR)(0x50 & 0xff)); /* AMPERSAND */
  1857.       case 0x00E9:
  1858. return((CHAR)(0x51 & 0xff)); /* SMALL LETTER E WITH ACUTE */
  1859.       case 0x00EA:
  1860. return((CHAR)(0x52 & 0xff)); /* SMALL LETTER E WITH CIRCUMFLEX */
  1861.       case 0x00EB:
  1862. return((CHAR)(0x53 & 0xff)); /* SMALL LETTER E WITH DIAERESIS */
  1863.       case 0x00E8:
  1864. return((CHAR)(0x54 & 0xff)); /* LATIN SMALL LETTER E WITH GRAVE */
  1865.       case 0x00ED:
  1866. return((CHAR)(0x55 & 0xff)); /* LATIN SMALL LETTER I WITH ACUTE */
  1867.       case 0x00EE:
  1868. return((CHAR)(0x56 & 0xff)); /* SMALL LETTER I WITH CIRCUMFLEX */
  1869.       case 0x00EF:
  1870. return((CHAR)(0x57 & 0xff)); /* SMALL LETTER I WITH DIAERESIS */
  1871.       case 0x00EC:
  1872. return((CHAR)(0x58 & 0xff)); /* LATIN SMALL LETTER I WITH GRAVE */
  1873.       case 0x00DF:
  1874. return((CHAR)(0x59 & 0xff)); /* SMALL LETTER SHARP S (GERMAN) */
  1875.       case 0x0021:
  1876. return((CHAR)(0x5A & 0xff)); /* EXCLAMATION MARK */
  1877.       case 0x0024:
  1878. return((CHAR)(0x5B & 0xff)); /* DOLLAR SIGN */
  1879.       case 0x002A:
  1880. return((CHAR)(0x5C & 0xff)); /* ASTERISK */
  1881.       case 0x0029:
  1882. return((CHAR)(0x5D & 0xff)); /* RIGHT PARENTHESIS */
  1883.       case 0x003B:
  1884. return((CHAR)(0x5E & 0xff)); /* SEMICOLON */
  1885.       case 0x00AC:
  1886. return((CHAR)(0x5F & 0xff)); /* NOT SIGN */
  1887.       case 0x002D:
  1888. return((CHAR)(0x60 & 0xff)); /* HYPHEN-MINUS */
  1889.       case 0x002F:
  1890. return((CHAR)(0x61 & 0xff)); /* SOLIDUS */
  1891.       case 0x00C2:
  1892. return((CHAR)(0x62 & 0xff)); /* CAPITAL LETTER A WITH CIRCUMFLEX */
  1893.       case 0x00C4:
  1894. return((CHAR)(0x63 & 0xff)); /* CAPITAL LETTER A WITH DIAERESIS */
  1895.       case 0x00C0:
  1896. return((CHAR)(0x64 & 0xff)); /* LATIN CAPITAL LETTER A WITH GRAVE */
  1897.       case 0x00C1:
  1898. return((CHAR)(0x65 & 0xff)); /* LATIN CAPITAL LETTER A WITH ACUTE */
  1899.       case 0x00C3:
  1900. return((CHAR)(0x66 & 0xff)); /* LATIN CAPITAL LETTER A WITH TILDE */
  1901.       case 0x00C5:
  1902. return((CHAR)(0x67 & 0xff)); /* CAPITAL LETTER A WITH RING ABOVE */
  1903.       case 0x00C7:
  1904. return((CHAR)(0x68 & 0xff)); /* CAPITAL LETTER C WITH CEDILLA */
  1905.       case 0x00D1:
  1906. return((CHAR)(0x69 & 0xff)); /* LATIN CAPITAL LETTER N WITH TILDE */
  1907.       case 0x00A6:
  1908. return((CHAR)(0x6A & 0xff)); /* BROKEN BAR */
  1909.       case 0x002C:
  1910. return((CHAR)(0x6B & 0xff)); /* COMMA */
  1911.       case 0x0025:
  1912. return((CHAR)(0x6C & 0xff)); /* PERCENT SIGN */
  1913.       case 0x005F:
  1914. return((CHAR)(0x6D & 0xff)); /* LOW LINE */
  1915.       case 0x003E:
  1916. return((CHAR)(0x6E & 0xff)); /* GREATER-THAN SIGN */
  1917.       case 0x003F:
  1918. return((CHAR)(0x6F & 0xff)); /* QUESTION MARK */
  1919.       case 0x00F8:
  1920. return((CHAR)(0x70 & 0xff)); /* LATIN SMALL LETTER O WITH STROKE */
  1921.       case 0x00C9:
  1922. return((CHAR)(0x71 & 0xff)); /* LATIN CAPITAL LETTER E WITH ACUTE */
  1923.       case 0x00CA:
  1924. /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */
  1925. return((CHAR)(0x72 & 0xff));
  1926.       case 0x00CB:
  1927. /* LATIN CAPITAL LETTER E WITH DIAERESIS */
  1928. return((CHAR)(0x73 & 0xff));
  1929.       case 0x00C8:
  1930. return((CHAR)(0x74 & 0xff)); /* LATIN CAPITAL LETTER E WITH GRAVE */
  1931.       case 0x00CD:
  1932. return((CHAR)(0x75 & 0xff)); /* LATIN CAPITAL LETTER I WITH ACUTE */
  1933.       case 0x00CE:
  1934. /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */
  1935. return((CHAR)(0x76 & 0xff));
  1936.       case 0x00CF:
  1937. /* LATIN CAPITAL LETTER I WITH DIAERESIS */
  1938. return((CHAR)(0x77 & 0xff));
  1939.       case 0x00CC:
  1940. return((CHAR)(0x78 & 0xff)); /* LATIN CAPITAL LETTER I WITH GRAVE */
  1941.       case 0x0060:
  1942. return((CHAR)(0x79 & 0xff)); /* GRAVE ACCENT */
  1943.       case 0x003A:
  1944. return((CHAR)(0x7A & 0xff)); /* COLON */
  1945.       case 0x0023:
  1946. return((CHAR)(0x7B & 0xff)); /* NUMBER SIGN */
  1947.       case 0x0040:
  1948. return((CHAR)(0x7C & 0xff)); /* COMMERCIAL AT */
  1949.       case 0x0027:
  1950. return((CHAR)(0x7D & 0xff)); /* APOSTROPHE */
  1951.       case 0x003D:
  1952. return((CHAR)(0x7E & 0xff)); /* EQUALS SIGN */
  1953.       case 0x0022:
  1954. return((CHAR)(0x7F & 0xff)); /* QUOTATION MARK */
  1955.       case 0x00D8:
  1956. /* LATIN CAPITAL LETTER O WITH STROKE */
  1957. return((CHAR)(0x80 & 0xff));
  1958.       case 0x0061:
  1959. return((CHAR)(0x81 & 0xff)); /* LATIN SMALL LETTER A */
  1960.       case 0x0062:
  1961. return((CHAR)(0x82 & 0xff)); /* LATIN SMALL LETTER B */
  1962.       case 0x0063:
  1963. return((CHAR)(0x83 & 0xff)); /* LATIN SMALL LETTER C */
  1964.       case 0x0064:
  1965. return((CHAR)(0x84 & 0xff)); /* LATIN SMALL LETTER D */
  1966.       case 0x0065:
  1967. return((CHAR)(0x85 & 0xff)); /* LATIN SMALL LETTER E */
  1968.       case 0x0066:
  1969. return((CHAR)(0x86 & 0xff)); /* LATIN SMALL LETTER F */
  1970.       case 0x0067:
  1971. return((CHAR)(0x87 & 0xff)); /* LATIN SMALL LETTER G */
  1972.       case 0x0068:
  1973. return((CHAR)(0x88 & 0xff)); /* LATIN SMALL LETTER H */
  1974.       case 0x0069:
  1975. return((CHAR)(0x89 & 0xff)); /* LATIN SMALL LETTER I */
  1976.       case 0x00AB:
  1977. /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */
  1978. return((CHAR)(0x8A & 0xff));
  1979.       case 0x00BB:
  1980. /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MAR K*/
  1981. return((CHAR)(0x8B & 0xff));
  1982.       case 0x00F0:
  1983. /* LATIN SMALL LETTER ETH (ICELANDIC) */
  1984. return((CHAR)(0x8C & 0xff));
  1985.       case 0x00FD:
  1986. return((CHAR)(0x8D & 0xff)); /* LATIN SMALL LETTER Y WITH ACUTE */
  1987.       case 0x00FE:
  1988. /* LATIN SMALL LETTER THORN (ICELANDIC) */
  1989. return((CHAR)(0x8E & 0xff));
  1990.       case 0x00B1:
  1991. return((CHAR)(0x8F & 0xff)); /* PLUS-MINUS SIGN */
  1992.       case 0x00B0:
  1993. return((CHAR)(0x90 & 0xff)); /* DEGREE SIGN */
  1994.       case 0x006A:
  1995. return((CHAR)(0x91 & 0xff)); /* LATIN SMALL LETTER J */
  1996.       case 0x006B:
  1997. return((CHAR)(0x92 & 0xff)); /* LATIN SMALL LETTER K */
  1998.       case 0x006C:
  1999. return((CHAR)(0x93 & 0xff)); /* LATIN SMALL LETTER L */
  2000.       case 0x006D:
  2001. return((CHAR)(0x94 & 0xff)); /* LATIN SMALL LETTER M */
  2002.       case 0x006E:
  2003. return((CHAR)(0x95 & 0xff)); /* LATIN SMALL LETTER N */
  2004.       case 0x006F:
  2005. return((CHAR)(0x96 & 0xff)); /* LATIN SMALL LETTER O */
  2006.       case 0x0070:
  2007. return((CHAR)(0x97 & 0xff)); /* LATIN SMALL LETTER P */
  2008.       case 0x0071:
  2009. return((CHAR)(0x98 & 0xff)); /* LATIN SMALL LETTER Q */
  2010.       case 0x0072:
  2011. return((CHAR)(0x99 & 0xff)); /* LATIN SMALL LETTER R */
  2012.       case 0x00AA:
  2013. return((CHAR)(0x9A & 0xff)); /* FEMININE ORDINAL INDICATOR */
  2014.       case 0x00BA:
  2015. return((CHAR)(0x9B & 0xff)); /* MASCULINE ORDINAL INDICATOR */
  2016.       case 0x00E6:
  2017. return((CHAR)(0x9C & 0xff)); /* LATIN SMALL LIGATURE AE */
  2018.       case 0x00B8:
  2019. return((CHAR)(0x9D & 0xff)); /* CEDILLA */
  2020.       case 0x00C6:
  2021. return((CHAR)(0x9E & 0xff)); /* LATIN CAPITAL LIGATURE AE */
  2022.       case 0x00A4:
  2023. return((CHAR)(0x9F & 0xff)); /* CURRENCY SIGN */
  2024.       case 0x00B5:
  2025. return((CHAR)(0xA0 & 0xff)); /* MICRO SIGN */
  2026.       case 0x007E:
  2027. return((CHAR)(0xA1 & 0xff)); /* TILDE */
  2028.       case 0x0073:
  2029. return((CHAR)(0xA2 & 0xff)); /* LATIN SMALL LETTER S */
  2030.       case 0x0074:
  2031. return((CHAR)(0xA3 & 0xff)); /* LATIN SMALL LETTER T */
  2032.       case 0x0075:
  2033. return((CHAR)(0xA4 & 0xff)); /* LATIN SMALL LETTER U */
  2034.       case 0x0076:
  2035. return((CHAR)(0xA5 & 0xff)); /* LATIN SMALL LETTER V */
  2036.       case 0x0077:
  2037. return((CHAR)(0xA6 & 0xff)); /* LATIN SMALL LETTER W */
  2038.       case 0x0078:
  2039. return((CHAR)(0xA7 & 0xff)); /* LATIN SMALL LETTER X */
  2040.       case 0x0079:
  2041. return((CHAR)(0xA8 & 0xff)); /* LATIN SMALL LETTER Y */
  2042.       case 0x007A:
  2043. return((CHAR)(0xA9 & 0xff)); /* LATIN SMALL LETTER Z */
  2044.       case 0x00A1:
  2045. return((CHAR)(0xAA & 0xff)); /* INVERTED EXCLAMATION MARK */
  2046.       case 0x00BF:
  2047. return((CHAR)(0xAB & 0xff)); /* INVERTED QUESTION MARK */
  2048.       case 0x00D0:
  2049. /* LATIN CAPITAL LETTER ETH (ICELANDIC) */
  2050. return((CHAR)(0xAC & 0xff));
  2051.       case 0x00DD:
  2052. return((CHAR)(0xAD & 0xff)); /* LATIN CAPITAL LETTER Y WITH ACUTE */
  2053.       case 0x00DE:
  2054. /* LATIN CAPITAL LETTER THORN (ICELANDIC) */
  2055. return((CHAR)(0xAE & 0xff));
  2056.       case 0x00AE:
  2057. return((CHAR)(0xAF & 0xff)); /* REGISTERED SIGN */
  2058.       case 0x005E:
  2059. return((CHAR)(0xB0 & 0xff)); /* CIRCUMFLEX ACCENT */
  2060.       case 0x00A3:
  2061. return((CHAR)(0xB1 & 0xff)); /* POUND SIGN */
  2062.       case 0x00A5:
  2063. return((CHAR)(0xB2 & 0xff)); /* YEN SIGN */
  2064.       case 0x00B7:
  2065. return((CHAR)(0xB3 & 0xff)); /* MIDDLE DOT */
  2066.       case 0x00A9:
  2067. return((CHAR)(0xB4 & 0xff)); /* COPYRIGHT SIGN */
  2068.       case 0x00A7:
  2069. return((CHAR)(0xB5 & 0xff)); /* SECTION SIGN */
  2070.       case 0x00B6:
  2071. return((CHAR)(0xB6 & 0xff)); /* PILCROW SIGN */
  2072.       case 0x00BC:
  2073. return((CHAR)(0xB7 & 0xff)); /* VULGAR FRACTION ONE QUARTER */
  2074.       case 0x00BD:
  2075. return((CHAR)(0xB8 & 0xff)); /* VULGAR FRACTION ONE HALF */
  2076.       case 0x00BE:
  2077. return((CHAR)(0xB9 & 0xff)); /* VULGAR FRACTION THREE QUARTERS */
  2078.       case 0x005B:
  2079. return((CHAR)(0xBA & 0xff)); /* LEFT SQUARE BRACKET */
  2080.       case 0x005D:
  2081. return((CHAR)(0xBB & 0xff)); /* RIGHT SQUARE BRACKET */
  2082.       case 0x00AF:
  2083. return((CHAR)(0xBC & 0xff)); /* MACRON */
  2084.       case 0x00A8:
  2085. return((CHAR)(0xBD & 0xff)); /* DIAERESIS */
  2086.       case 0x00B4:
  2087. return((CHAR)(0xBE & 0xff)); /* ACUTE ACCENT */
  2088.       case 0x00D7:
  2089. return((CHAR)(0xBF & 0xff)); /* MULTIPLICATION SIGN */
  2090.       case 0x007B:
  2091. return((CHAR)(0xC0 & 0xff)); /* LEFT CURLY BRACKET */
  2092.       case 0x0041:
  2093. return((CHAR)(0xC1 & 0xff)); /* LATIN CAPITAL LETTER A */
  2094.       case 0x0042:
  2095. return((CHAR)(0xC2 & 0xff)); /* LATIN CAPITAL LETTER B */
  2096.       case 0x0043:
  2097. return((CHAR)(0xC3 & 0xff)); /* LATIN CAPITAL LETTER C */
  2098.       case 0x0044:
  2099. return((CHAR)(0xC4 & 0xff)); /* LATIN CAPITAL LETTER D */
  2100.       case 0x0045:
  2101. return((CHAR)(0xC5 & 0xff)); /* LATIN CAPITAL LETTER E */
  2102.       case 0x0046:
  2103. return((CHAR)(0xC6 & 0xff)); /* LATIN CAPITAL LETTER F */
  2104.       case 0x0047:
  2105. return((CHAR)(0xC7 & 0xff)); /* LATIN CAPITAL LETTER G */
  2106.       case 0x0048:
  2107. return((CHAR)(0xC8 & 0xff)); /* LATIN CAPITAL LETTER H */
  2108.       case 0x0049:
  2109. return((CHAR)(0xC9 & 0xff)); /* LATIN CAPITAL LETTER I */
  2110.       case 0x00AD:
  2111. return((CHAR)(0xCA & 0xff)); /* SOFT HYPHEN */
  2112.       case 0x00F4:
  2113. return((CHAR)(0xCB & 0xff)); /* SMALL LETTER O WITH CIRCUMFLEX */
  2114.       case 0x00F6:
  2115. return((CHAR)(0xCC & 0xff)); /* SMALL LETTER O WITH DIAERESIS */
  2116.       case 0x00F2:
  2117. return((CHAR)(0xCD & 0xff)); /* LATIN SMALL LETTER O WITH GRAVE */
  2118.       case 0x00F3:
  2119. return((CHAR)(0xCE & 0xff)); /* LATIN SMALL LETTER O WITH ACUTE */
  2120.       case 0x00F5:
  2121. return((CHAR)(0xCF & 0xff)); /* LATIN SMALL LETTER O WITH TILDE */
  2122.       case 0x007D:
  2123. return((CHAR)(0xD0 & 0xff)); /* RIGHT CURLY BRACKET */
  2124.       case 0x004A:
  2125. return((CHAR)(0xD1 & 0xff)); /* LATIN CAPITAL LETTER J */
  2126.       case 0x004B:
  2127. return((CHAR)(0xD2 & 0xff)); /* LATIN CAPITAL LETTER K */
  2128.       case 0x004C:
  2129. return((CHAR)(0xD3 & 0xff)); /* LATIN CAPITAL LETTER L */
  2130.       case 0x004D:
  2131. return((CHAR)(0xD4 & 0xff)); /* LATIN CAPITAL LETTER M */
  2132.       case 0x004E:
  2133. return((CHAR)(0xD5 & 0xff)); /* LATIN CAPITAL LETTER N */
  2134.       case 0x004F:
  2135. return((CHAR)(0xD6 & 0xff)); /* LATIN CAPITAL LETTER O */
  2136.       case 0x0050:
  2137. return((CHAR)(0xD7 & 0xff)); /* LATIN CAPITAL LETTER P */
  2138.       case 0x0051:
  2139. return((CHAR)(0xD8 & 0xff)); /* LATIN CAPITAL LETTER Q */
  2140.       case 0x0052:
  2141. return((CHAR)(0xD9 & 0xff)); /* LATIN CAPITAL LETTER R */
  2142.       case 0x00B9:
  2143. return((CHAR)(0xDA & 0xff)); /* SUPERSCRIPT ONE */
  2144.       case 0x00FB:
  2145. return((CHAR)(0xDB & 0xff)); /* SMALL LETTER U WITH CIRCUMFLEX */
  2146.       case 0x00FC:
  2147. return((CHAR)(0xDC & 0xff)); /* SMALL LETTER U WITH DIAERESIS */
  2148.       case 0x00F9:
  2149. return((CHAR)(0xDD & 0xff)); /* SMALL LETTER U WITH GRAVE */
  2150.       case 0x00FA:
  2151. return((CHAR)(0xDE & 0xff)); /* SMALL LETTER U WITH ACUTE */
  2152.       case 0x00FF:
  2153. return((CHAR)(0xDF & 0xff)); /* SMALL LETTER Y WITH DIAERESIS */
  2154.       case 0x005C:
  2155. return((CHAR)(0xE0 & 0xff)); /* REVERSE SOLIDUS */
  2156.       case 0x00F7:
  2157. return((CHAR)(0xE1 & 0xff)); /* DIVISION SIGN */
  2158.       case 0x0053:
  2159. return((CHAR)(0xE2 & 0xff)); /* LATIN CAPITAL LETTER S */
  2160.       case 0x0054:
  2161. return((CHAR)(0xE3 & 0xff)); /* LATIN CAPITAL LETTER T */
  2162.       case 0x0055:
  2163. return((CHAR)(0xE4 & 0xff)); /* LATIN CAPITAL LETTER U */
  2164.       case 0x0056:
  2165. return((CHAR)(0xE5 & 0xff)); /* LATIN CAPITAL LETTER V */
  2166.       case 0x0057:
  2167. return((CHAR)(0xE6 & 0xff)); /* LATIN CAPITAL LETTER W */
  2168.       case 0x0058:
  2169. return((CHAR)(0xE7 & 0xff)); /* LATIN CAPITAL LETTER X */
  2170.       case 0x0059:
  2171. return((CHAR)(0xE8 & 0xff)); /* LATIN CAPITAL LETTER Y */
  2172.       case 0x005A:
  2173. return((CHAR)(0xE9 & 0xff)); /* LATIN CAPITAL LETTER Z */
  2174.       case 0x00B2:
  2175. return((CHAR)(0xEA & 0xff)); /* SUPERSCRIPT TWO */
  2176.       case 0x00D4:
  2177. return((CHAR)(0xEB & 0xff)); /* CAPITAL LETTER O WITH CIRCUMFLEX */
  2178.       case 0x00D6:
  2179. return((CHAR)(0xEC & 0xff)); /* CAPITAL LETTER O WITH DIAERESIS */
  2180.       case 0x00D2:
  2181. return((CHAR)(0xED & 0xff)); /* CAPITAL LETTER O WITH GRAVE */
  2182.       case 0x00D3:
  2183. return((CHAR)(0xEE & 0xff)); /* CAPITAL LETTER O WITH ACUTE */
  2184.       case 0x00D5:
  2185. return((CHAR)(0xEF & 0xff)); /* CAPITAL LETTER O WITH TILDE */
  2186.       case 0x0030:
  2187. return((CHAR)(0xF0 & 0xff)); /* DIGIT ZERO */
  2188.       case 0x0031:
  2189. return((CHAR)(0xF1 & 0xff)); /* DIGIT ONE */
  2190.       case 0x0032:
  2191. return((CHAR)(0xF2 & 0xff)); /* DIGIT TWO */
  2192.       case 0x0033:
  2193. return((CHAR)(0xF3 & 0xff)); /* DIGIT THREE */
  2194.       case 0x0034:
  2195. return((CHAR)(0xF4 & 0xff)); /* DIGIT FOUR */
  2196.       case 0x0035:
  2197. return((CHAR)(0xF5 & 0xff)); /* DIGIT FIVE */
  2198.       case 0x0036:
  2199. return((CHAR)(0xF6 & 0xff)); /* DIGIT SIX */
  2200.       case 0x0037:
  2201. return((CHAR)(0xF7 & 0xff)); /* DIGIT SEVEN */
  2202.       case 0x0038:
  2203. return((CHAR)(0xF8 & 0xff)); /* DIGIT EIGHT */
  2204.       case 0x0039:
  2205. return((CHAR)(0xF9 & 0xff)); /* DIGIT NINE */
  2206.       case 0x00B3:
  2207. return((CHAR)(0xFA & 0xff)); /* SUPERSCRIPT THREE */
  2208.       case 0x00DB:
  2209. return((CHAR)(0xFB & 0xff)); /* CAPITAL LETTER U WITH CIRCUMFLEX */
  2210.       case 0x00DC:
  2211. return((CHAR)(0xFC & 0xff)); /* CAPITAL LETTER U WITH DIAERESIS */
  2212.       case 0x00D9:
  2213. return((CHAR)(0xFD & 0xff)); /* LATIN CAPITAL LETTER U WITH GRAVE */
  2214.       case 0x00DA:
  2215. return((CHAR)(0xFE & 0xff)); /* LATIN CAPITAL LETTER U WITH ACUTE */
  2216.       case 0x009F:
  2217. return((CHAR)(0xFF & 0xff)); /* CONTROL */
  2218.     default: return(0x003f);
  2219.     }
  2220. }
  2221. int /* PC Code Page 855 */
  2222. #ifdef CK_ANSIC
  2223. tx_cp855(USHORT c)
  2224. #else
  2225. tx_cp855(c) USHORT c;
  2226. #endif /* CK_ANSIC */
  2227. {
  2228.     if (c < 0x80) /* Has C1 graphics */
  2229.       return((CHAR)(c & 0xff));
  2230.     switch (c) {
  2231.       case 0x00a4: return((CHAR)(207 & 0xff));
  2232.       case 0x00a7: return((CHAR)(253 & 0xff));
  2233.       case 0x00ab: return((CHAR)(174 & 0xff));
  2234.       case 0x00bb: return((CHAR)(175 & 0xff));
  2235.       case 0x0401: return((CHAR)(133 & 0xff));
  2236.       case 0x0402: return((CHAR)(129 & 0xff));
  2237.       case 0x0403: return((CHAR)(131 & 0xff));
  2238.       case 0x0404: return((CHAR)(135 & 0xff));
  2239.       case 0x0405: return((CHAR)(137 & 0xff));
  2240.       case 0x0406: return((CHAR)(139 & 0xff));
  2241.       case 0x0407: return((CHAR)(141 & 0xff));
  2242.       case 0x0408: return((CHAR)(143 & 0xff));
  2243.       case 0x0409: return((CHAR)(145 & 0xff));
  2244.       case 0x040a: return((CHAR)(147 & 0xff));
  2245.       case 0x040b: return((CHAR)(149 & 0xff));
  2246.       case 0x040c: return((CHAR)(151 & 0xff));
  2247.       case 0x040e: return((CHAR)(153 & 0xff));
  2248.       case 0x040f: return((CHAR)(155 & 0xff));
  2249.       case 0x0410: return((CHAR)(161 & 0xff));
  2250.       case 0x0411: return((CHAR)(163 & 0xff));
  2251.       case 0x0412: return((CHAR)(236 & 0xff));
  2252.       case 0x0413: return((CHAR)(173 & 0xff));
  2253.       case 0x0414: return((CHAR)(167 & 0xff));
  2254.       case 0x0415: return((CHAR)(169 & 0xff));
  2255.       case 0x0416: return((CHAR)(234 & 0xff));
  2256.       case 0x0417: return((CHAR)(244 & 0xff));
  2257.       case 0x0418: return((CHAR)(184 & 0xff));
  2258.       case 0x0419: return((CHAR)(190 & 0xff));
  2259.       case 0x041a: return((CHAR)(199 & 0xff));
  2260.       case 0x041b: return((CHAR)(209 & 0xff));
  2261.       case 0x041c: return((CHAR)(211 & 0xff));
  2262.       case 0x041d: return((CHAR)(213 & 0xff));
  2263.       case 0x041e: return((CHAR)(215 & 0xff));
  2264.       case 0x041f: return((CHAR)(221 & 0xff));
  2265.       case 0x0420: return((CHAR)(226 & 0xff));
  2266.       case 0x0421: return((CHAR)(228 & 0xff));
  2267.       case 0x0422: return((CHAR)(230 & 0xff));
  2268.       case 0x0423: return((CHAR)(232 & 0xff));
  2269.       case 0x0424: return((CHAR)(171 & 0xff));
  2270.       case 0x0425: return((CHAR)(182 & 0xff));
  2271.       case 0x0426: return((CHAR)(165 & 0xff));
  2272.       case 0x0427: return((CHAR)(252 & 0xff));
  2273.       case 0x0428: return((CHAR)(246 & 0xff));
  2274.       case 0x0429: return((CHAR)(250 & 0xff));
  2275.       case 0x042a: return((CHAR)(159 & 0xff));
  2276.       case 0x042b: return((CHAR)(242 & 0xff));
  2277.       case 0x042c: return((CHAR)(238 & 0xff));
  2278.       case 0x042d: return((CHAR)(248 & 0xff));
  2279.       case 0x042e: return((CHAR)(157 & 0xff));
  2280.       case 0x042f: return((CHAR)(224 & 0xff));
  2281.       case 0x0430: return((CHAR)(160 & 0xff));
  2282.       case 0x0431: return((CHAR)(162 & 0xff));
  2283.       case 0x0432: return((CHAR)(235 & 0xff));
  2284.       case 0x0433: return((CHAR)(172 & 0xff));
  2285.       case 0x0434: return((CHAR)(166 & 0xff));
  2286.       case 0x0435: return((CHAR)(168 & 0xff));
  2287.       case 0x0436: return((CHAR)(233 & 0xff));
  2288.       case 0x0437: return((CHAR)(243 & 0xff));
  2289.       case 0x0438: return((CHAR)(183 & 0xff));
  2290.       case 0x0439: return((CHAR)(189 & 0xff));
  2291.       case 0x043a: return((CHAR)(198 & 0xff));
  2292.       case 0x043b: return((CHAR)(208 & 0xff));
  2293.       case 0x043c: return((CHAR)(210 & 0xff));
  2294.       case 0x043d: return((CHAR)(212 & 0xff));
  2295.       case 0x043e: return((CHAR)(214 & 0xff));
  2296.       case 0x043f: return((CHAR)(216 & 0xff));
  2297.       case 0x0440: return((CHAR)(225 & 0xff));
  2298.       case 0x0441: return((CHAR)(227 & 0xff));
  2299.       case 0x0442: return((CHAR)(229 & 0xff));
  2300.       case 0x0443: return((CHAR)(231 & 0xff));
  2301.       case 0x0444: return((CHAR)(170 & 0xff));
  2302.       case 0x0445: return((CHAR)(181 & 0xff));
  2303.       case 0x0446: return((CHAR)(164 & 0xff));
  2304.       case 0x0447: return((CHAR)(251 & 0xff));
  2305.       case 0x0448: return((CHAR)(245 & 0xff));
  2306.       case 0x0449: return((CHAR)(249 & 0xff));
  2307.       case 0x044a: return((CHAR)(158 & 0xff));
  2308.       case 0x044b: return((CHAR)(241 & 0xff));
  2309.       case 0x044c: return((CHAR)(237 & 0xff));
  2310.       case 0x044d: return((CHAR)(247 & 0xff));
  2311.       case 0x044e: return((CHAR)(156 & 0xff));
  2312.       case 0x044f: return((CHAR)(222 & 0xff));
  2313.       case 0x0451: return((CHAR)(132 & 0xff));
  2314.       case 0x0452: return((CHAR)(128 & 0xff));
  2315.       case 0x0453: return((CHAR)(130 & 0xff));
  2316.       case 0x0454: return((CHAR)(134 & 0xff));
  2317.       case 0x0455: return((CHAR)(136 & 0xff));
  2318.       case 0x0456: return((CHAR)(138 & 0xff));
  2319.       case 0x0457: return((CHAR)(140 & 0xff));
  2320.       case 0x0458: return((CHAR)(142 & 0xff));
  2321.       case 0x0459: return((CHAR)(144 & 0xff));
  2322.       case 0x045a: return((CHAR)(146 & 0xff));
  2323.       case 0x045b: return((CHAR)(148 & 0xff));
  2324.       case 0x045c: return((CHAR)(150 & 0xff));
  2325.       case 0x045e: return((CHAR)(152 & 0xff));
  2326.       case 0x045f: return((CHAR)(154 & 0xff));
  2327.       case 0x2116: return((CHAR)(239 & 0xff));
  2328.       case 0x2500: return((CHAR)(196 & 0xff));
  2329.       case 0x2502: return((CHAR)(179 & 0xff));
  2330.       case 0x250c: return((CHAR)(218 & 0xff));
  2331.       case 0x2510: return((CHAR)(191 & 0xff));
  2332.       case 0x2514: return((CHAR)(192 & 0xff));
  2333.       case 0x2518: return((CHAR)(217 & 0xff));
  2334.       case 0x251c: return((CHAR)(195 & 0xff));
  2335.       case 0x2524: return((CHAR)(180 & 0xff));
  2336.       case 0x252c: return((CHAR)(194 & 0xff));
  2337.       case 0x2534: return((CHAR)(193 & 0xff));
  2338.       case 0x253c: return((CHAR)(197 & 0xff));
  2339.       case 0x2550: return((CHAR)(205 & 0xff));
  2340.       case 0x2551: return((CHAR)(186 & 0xff));
  2341.       case 0x2554: return((CHAR)(201 & 0xff));
  2342.       case 0x2557: return((CHAR)(187 & 0xff));
  2343.       case 0x255a: return((CHAR)(200 & 0xff));
  2344.       case 0x255d: return((CHAR)(188 & 0xff));
  2345.       case 0x2560: return((CHAR)(204 & 0xff));
  2346.       case 0x2563: return((CHAR)(185 & 0xff));
  2347.       case 0x2566: return((CHAR)(203 & 0xff));
  2348.       case 0x2569: return((CHAR)(202 & 0xff));
  2349.       case 0x256c: return((CHAR)(206 & 0xff));
  2350.       case 0x2580: return((CHAR)(223 & 0xff));
  2351.       case 0x2584: return((CHAR)(220 & 0xff));
  2352.       case 0x2588: return((CHAR)(219 & 0xff));
  2353.       case 0x2591: return((CHAR)(176 & 0xff));
  2354.       case 0x2592: return((CHAR)(177 & 0xff));
  2355.       case 0x2593: return((CHAR)(178 & 0xff));
  2356.       case 0x25a0: return((CHAR)(254 & 0xff));
  2357.       default: return(tx_cpsub(c)); /* For box characters etc */
  2358.     }
  2359. }
  2360. int /* PC Code Page 856 */
  2361. #ifdef CK_ANSIC
  2362. tx_cp856(USHORT c)
  2363. #else
  2364. tx_cp856(c) USHORT c;
  2365. #endif /* CK_ANSIC */
  2366. {
  2367.     if (c < 0x80) /* Has C1 graphics */
  2368.       return((CHAR)(c & 0xff));
  2369.     switch (c) {
  2370.       case 0x00a0: return((CHAR)(0xff & 0xff));
  2371.       case 0x00a7: return((CHAR)(0xd6 & 0xff));
  2372.       case 0x00b0: return((CHAR)(0xf8 & 0xff));
  2373.       case 0x00b1: return((CHAR)(0xf1 & 0xff));
  2374.       case 0x00b2: return((CHAR)(0xfd & 0xff));
  2375.       case 0x00b5: return((CHAR)(0xe6 & 0xff));
  2376.       case 0x00b7: return((CHAR)(0xfa & 0xff));
  2377.       case 0x00df: return((CHAR)(0xe1 & 0xff));
  2378.       case 0x00f7: return((CHAR)(0xf6 & 0xff));
  2379.       case 0x0393: return((CHAR)(0xe2 & 0xff));
  2380.       case 0x0398: return((CHAR)(0xe9 & 0xff));
  2381.       case 0x03a3: return((CHAR)(0xe4 & 0xff));
  2382.       case 0x03a6: return((CHAR)(0xe8 & 0xff));
  2383.       case 0x03a9: return((CHAR)(0xea & 0xff));
  2384.       case 0x03b1: return((CHAR)(0xe0 & 0xff));
  2385.       case 0x03b4: return((CHAR)(0xeb & 0xff));
  2386.       case 0x03b5: return((CHAR)(0xee & 0xff));
  2387.       case 0x03c0: return((CHAR)(0xe3 & 0xff));
  2388.       case 0x03c3: return((CHAR)(0xe5 & 0xff));
  2389.       case 0x03c4: return((CHAR)(0xe7 & 0xff));
  2390.       case 0x03c6: return((CHAR)(0xed & 0xff));
  2391.       case 0x0410: return((CHAR)(0x80 & 0xff));
  2392.       case 0x0411: return((CHAR)(0x81 & 0xff));
  2393.       case 0x0412: return((CHAR)(0x82 & 0xff));
  2394.       case 0x0413: return((CHAR)(0x83 & 0xff));
  2395.       case 0x0414: return((CHAR)(0x84 & 0xff));
  2396.       case 0x0415: return((CHAR)(0x85 & 0xff));
  2397.       case 0x0416: return((CHAR)(0x86 & 0xff));
  2398.       case 0x0417: return((CHAR)(0x87 & 0xff));
  2399.       case 0x0418: return((CHAR)(0x88 & 0xff));
  2400.       case 0x0419: return((CHAR)(0x89 & 0xff));
  2401.       case 0x041a: return((CHAR)(0x8a & 0xff));
  2402.       case 0x041b: return((CHAR)(0x8b & 0xff));
  2403.       case 0x041c: return((CHAR)(0x8c & 0xff));
  2404.       case 0x041d: return((CHAR)(0x8d & 0xff));
  2405.       case 0x041e: return((CHAR)(0x8e & 0xff));
  2406.       case 0x041f: return((CHAR)(0x8f & 0xff));
  2407.       case 0x0420: return((CHAR)(0x90 & 0xff));
  2408.       case 0x0421: return((CHAR)(0x91 & 0xff));
  2409.       case 0x0422: return((CHAR)(0x92 & 0xff));
  2410.       case 0x0423: return((CHAR)(0x93 & 0xff));
  2411.       case 0x0424: return((CHAR)(0x94 & 0xff));
  2412.       case 0x0425: return((CHAR)(0x95 & 0xff));
  2413.       case 0x0426: return((CHAR)(0x96 & 0xff));
  2414.       case 0x0427: return((CHAR)(0x97 & 0xff));
  2415.       case 0x0428: return((CHAR)(0x98 & 0xff));
  2416.       case 0x0429: return((CHAR)(0x99 & 0xff));
  2417.       case 0x042a: return((CHAR)(0x9a & 0xff));
  2418.       case 0x042b: return((CHAR)(0x9b & 0xff));
  2419.       case 0x042c: return((CHAR)(0x9c & 0xff));
  2420.       case 0x042d: return((CHAR)(0x9d & 0xff));
  2421.       case 0x042e: return((CHAR)(0x9e & 0xff));
  2422.       case 0x042f: return((CHAR)(0x9f & 0xff));
  2423.       case 0x0430: return((CHAR)(0xa0 & 0xff));
  2424.       case 0x0431: return((CHAR)(0xa1 & 0xff));
  2425.       case 0x0432: return((CHAR)(0xa2 & 0xff));
  2426.       case 0x0433: return((CHAR)(0xa3 & 0xff));
  2427.       case 0x0434: return((CHAR)(0xa4 & 0xff));
  2428.       case 0x0435: return((CHAR)(0xa5 & 0xff));
  2429.       case 0x0436: return((CHAR)(0xa6 & 0xff));
  2430.       case 0x0437: return((CHAR)(0xa7 & 0xff));
  2431.       case 0x0438: return((CHAR)(0xa8 & 0xff));
  2432.       case 0x0439: return((CHAR)(0xa9 & 0xff));
  2433.       case 0x043a: return((CHAR)(0xaa & 0xff));
  2434.       case 0x043b: return((CHAR)(0xab & 0xff));
  2435.       case 0x043c: return((CHAR)(0xac & 0xff));
  2436.       case 0x043d: return((CHAR)(0xad & 0xff));
  2437.       case 0x043e: return((CHAR)(0xae & 0xff));
  2438.       case 0x043f: return((CHAR)(0xaf & 0xff));
  2439.       case 0x0440: return((CHAR)(0xb0 & 0xff));
  2440.       case 0x0441: return((CHAR)(0xb1 & 0xff));
  2441.       case 0x0442: return((CHAR)(0xb2 & 0xff));
  2442.       case 0x0443: return((CHAR)(0xb3 & 0xff));
  2443.       case 0x0444: return((CHAR)(0xb4 & 0xff));
  2444.       case 0x0445: return((CHAR)(0xb5 & 0xff));
  2445.       case 0x0446: return((CHAR)(0xb6 & 0xff));
  2446.       case 0x0447: return((CHAR)(0xb7 & 0xff));
  2447.       case 0x0448: return((CHAR)(0xb8 & 0xff));
  2448.       case 0x0449: return((CHAR)(0xb9 & 0xff));
  2449.       case 0x044a: return((CHAR)(0xba & 0xff));
  2450.       case 0x044b: return((CHAR)(0xbb & 0xff));
  2451.       case 0x044c: return((CHAR)(0xbc & 0xff));
  2452.       case 0x044d: return((CHAR)(0xbd & 0xff));
  2453.       case 0x044e: return((CHAR)(0xbe & 0xff));
  2454.       case 0x044f: return((CHAR)(0xbf & 0xff));
  2455.       case 0x207f: return((CHAR)(0xfc & 0xff));
  2456.       case 0x2116: return((CHAR)(0xd5 & 0xff));
  2457.       case 0x2219: return((CHAR)(0xf9 & 0xff));
  2458.       case 0x221a: return((CHAR)(0xfb & 0xff));
  2459.       case 0x221e: return((CHAR)(0xec & 0xff));
  2460.       case 0x2229: return((CHAR)(0xef & 0xff));
  2461.       case 0x2248: return((CHAR)(0xf7 & 0xff));
  2462.       case 0x2261: return((CHAR)(0xf0 & 0xff));
  2463.       case 0x2264: return((CHAR)(0xf3 & 0xff));
  2464.       case 0x2265: return((CHAR)(0xf2 & 0xff));
  2465.       case 0x2320: return((CHAR)(0xf4 & 0xff));
  2466.       case 0x2321: return((CHAR)(0xf5 & 0xff));
  2467.       case 0x2500: return((CHAR)(0xc4 & 0xff));
  2468.       case 0x2502: return((CHAR)(0xd3 & 0xff));
  2469.       case 0x250c: return((CHAR)(0xda & 0xff));
  2470.       case 0x2510: return((CHAR)(0xcf & 0xff));
  2471.       case 0x2514: return((CHAR)(0xc0 & 0xff));
  2472.       case 0x2518: return((CHAR)(0xd9 & 0xff));
  2473.       case 0x251c: return((CHAR)(0xc3 & 0xff));
  2474.       case 0x2524: return((CHAR)(0xd4 & 0xff));
  2475.       case 0x252c: return((CHAR)(0xc2 & 0xff));
  2476.       case 0x2534: return((CHAR)(0xc1 & 0xff));
  2477.       case 0x253c: return((CHAR)(0xc5 & 0xff));
  2478.       case 0x2550: return((CHAR)(0xcd & 0xff));
  2479.       case 0x2551: return((CHAR)(0xc7 & 0xff));
  2480.       case 0x2554: return((CHAR)(0xc9 & 0xff));
  2481.       case 0x2557: return((CHAR)(0xd7 & 0xff));
  2482.       case 0x255a: return((CHAR)(0xc8 & 0xff));
  2483.       case 0x255d: return((CHAR)(0xd8 & 0xff));
  2484.       case 0x2560: return((CHAR)(0xcc & 0xff));
  2485.       case 0x2563: return((CHAR)(0xc6 & 0xff));
  2486.       case 0x2566: return((CHAR)(0xcb & 0xff));
  2487.       case 0x2569: return((CHAR)(0xca & 0xff));
  2488.       case 0x256c: return((CHAR)(0xce & 0xff));
  2489.       case 0x2580: return((CHAR)(0xdf & 0xff));
  2490.       case 0x2584: return((CHAR)(0xdc & 0xff));
  2491.       case 0x2588: return((CHAR)(0xdb & 0xff));
  2492.       case 0x258c: return((CHAR)(0xdd & 0xff));
  2493.       case 0x2590: return((CHAR)(0xde & 0xff));
  2494.       case 0x2591: return((CHAR)(0xd0 & 0xff));
  2495.       case 0x2592: return((CHAR)(0xd1 & 0xff));
  2496.       case 0x2593: return((CHAR)(0xd2 & 0xff));
  2497.       case 0x25a0: return((CHAR)(0xfe & 0xff));
  2498.       default: return(tx_cpsub(c)); /* For box characters etc */
  2499.     }
  2500. }
  2501. int /* PC Code Page 857 */
  2502. #ifdef CK_ANSIC
  2503. tx_cp857(USHORT c)
  2504. #else
  2505. tx_cp857(c) USHORT c;
  2506. #endif /* CK_ANSIC */
  2507. {
  2508.     if (c < 0x80) /* Has C1 graphics */
  2509.       return((CHAR)(c & 0xff));
  2510.     switch (c) {
  2511.       case 0x00c7: return((CHAR)(128 & 0xff));
  2512.       case 0x00fc: return((CHAR)(129 & 0xff));
  2513.       case 0x00e9: return((CHAR)(130 & 0xff));
  2514.       case 0x00e2: return((CHAR)(131 & 0xff));
  2515.       case 0x00e4: return((CHAR)(132 & 0xff));
  2516.       case 0x00e0: return((CHAR)(133 & 0xff));
  2517.       case 0x00e5: return((CHAR)(134 & 0xff));
  2518.       case 0x00e7: return((CHAR)(135 & 0xff));
  2519.       case 0x00ea: return((CHAR)(136 & 0xff));
  2520.       case 0x00eb: return((CHAR)(137 & 0xff));
  2521.       case 0x00e8: return((CHAR)(138 & 0xff));
  2522.       case 0x00ef: return((CHAR)(139 & 0xff));
  2523.       case 0x00ee: return((CHAR)(140 & 0xff));
  2524.       case 0x0131: return((CHAR)(141 & 0xff));
  2525.       case 0x00c4: return((CHAR)(142 & 0xff));
  2526.       case 0x00c5: return((CHAR)(143 & 0xff));
  2527.       case 0x00c9: return((CHAR)(144 & 0xff));
  2528.       case 0x00e6: return((CHAR)(145 & 0xff));
  2529.       case 0x00c6: return((CHAR)(146 & 0xff));
  2530.       case 0x00f4: return((CHAR)(147 & 0xff));
  2531.       case 0x00f6: return((CHAR)(148 & 0xff));
  2532.       case 0x00f2: return((CHAR)(149 & 0xff));
  2533.       case 0x00fb: return((CHAR)(150 & 0xff));
  2534.       case 0x00f9: return((CHAR)(151 & 0xff));
  2535.       case 0x0130: return((CHAR)(152 & 0xff));