w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

encode.c
Go to the documentation of this file.
1 /* encode.c - Translate high bit chars into RTF using codepage 1252
2 
3 Copyright (C) 1995-2002 The Free Software Foundation
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 This file is available from http://sourceforge.net/projects/latex2rtf/
20 
21 Authors:
22  1995-1997 Ralf Schlatterbeck
23  1998-2000 Georg Lehner
24  2001-2002 Scott Prahl
25 */
26 
27 #include <stdlib.h>
28 #include <string.h>
29 #include "main.h"
30 #include "l2r_fonts.h"
31 #include "funct1.h"
32 #include "encode.h"
33 #include "encode_tables.h"
34 #include "chars.h"
35 
36 static void put_breve_char(char c)
37 {
38  int num = RtfFontNumber("MT Extra");
39  int upsize = CurrentFontSize()/2;
40  fprintRTF("{\\field{\\*\\fldinst EQ \\\\O(%c",c);
41  fprintRTF("%c\\\\S(\\up%d\\f%d \\\\())}", g_field_separator, upsize, num);
42  fprintRTF("{\\fldrslt }}");
43 }
44 
45 static void put_acute_char(char c)
46 {
47  fprintRTF("{\\field{\\*\\fldinst EQ \\\\O(%c",c);
48  fprintRTF("%c\\\\S(\\'b4))}", g_field_separator);
49  fprintRTF("{\\fldrslt }}");
50 }
51 
52 static void put_cedilla_char(char c)
53 {
54  int down = CurrentFontSize() / 4;
55  fprintRTF("{\\field{\\*\\fldinst EQ \\\\O(%c",c);
56  fprintRTF("%c\\\\S(\\dn%d\\'b8))}", g_field_separator,down);
57  fprintRTF("{\\fldrslt }}");
58 }
59 
60 static void put_ring_char(char c)
61 {
62  fprintRTF("{\\field{\\*\\fldinst EQ \\\\O(%c",c);
63  fprintRTF("%c\\\\S(\\'b0))}", g_field_separator);
64  fprintRTF("{\\fldrslt }}");
65 }
66 
67 static void put_macron_char(char c)
68 {
69  fprintRTF("{\\field{\\*\\fldinst EQ \\\\O(%c",c);
70  fprintRTF("%c\\\\S(\\'af))}", g_field_separator);
71  fprintRTF("{\\fldrslt }}");
72 }
73 
74 static void put_tilde_char(char c)
75 {
76  int num = RtfFontNumber("MT Extra");
77  fprintRTF("{\\field{\\*\\fldinst EQ \\\\O(%c",c);
78  fprintRTF("%c\\\\S(\\f%d\\'25))}", g_field_separator, num);
79  fprintRTF("{\\fldrslt }}");
80 }
81 
82 static void put_dot_char(char c)
83 {
84  int num = RtfFontNumber("MT Extra");
85  fprintRTF("{\\field{\\*\\fldinst EQ \\\\O(%c",c);
86  fprintRTF("%c\\\\S(\\f%d\\'26))}", g_field_separator, num);
87  fprintRTF("{\\fldrslt }}");
88 }
89 
90 static void applemac_enc(int index)
91 {
92 char *s;
94  if (s[0]!='0'){
95  fprintRTF("\\'%s",s);
96  return;
97  }
99  if (s[0]!='0'){
100  int num=RtfFontNumber("Symbol");
101  fprintRTF("{\\f%d\\'%s}",num,s);
102  return;
103  }
104  if (0xDE) { /* U+64257 LATIN SMALL LIGATURE FI */
105  fprintRTF("fi");
106  return;
107  }
108  if (index + 128 == 0xDF) { /* U+64258 LATIN SMALL LIGATURE FL */
109  fprintRTF("fl");
110  return;
111  }
112  if (index + 128 == 0xF0) { /* U+65535 unknown */
113 /* fprintRTF("TRANSLATION");*/
114  return;
115  }
116  if (index + 128 == 0xF5) { /* U+305 LATIN SMALL LETTER DOTLESS I */
117  fprintRTF("i");
118  return;
119  }
120  if (index + 128 == 0xF9) { /* U+728 BREVE */
121  int num = RtfFontNumber("MT Extra");
122  fprintRTF("{\\f%d\\'28}", num);
123  return;
124  }
125  if (index + 128 == 0xFA) { /* U+729 DOT ABOVE */
126  put_dot_char(' ');
127  return;
128  }
129  if (index + 128 == 0xFB) { /* U+730 RING ABOVE */
130  put_ring_char(' ');
131  return;
132  }
133  if (index + 128 == 0xFD) { /* U+733 DOUBLE ACUTE ACCENT */
134 /* fprintRTF("TRANSLATION");*/
135  return;
136  }
137  if (index + 128 == 0xFE) { /* U+731 OGONEK */
138 /* fprintRTF("TRANSLATION");*/
139  return;
140  }
141  if (index + 128 == 0xFF) { /* U+711 CARON */
142 /* fprintRTF("TRANSLATION");*/
143  return;
144  }
145 }
146 
147 static void cp437_enc(int index)
148 {
149 char *s;
150  s = cp437_2_ansi[index];
151  if (s[0]!='0'){
152  fprintRTF("\\'%s",s);
153  return;
154  }
155  s = cp437_2_sym[index];
156  if (s[0]!='0'){
157  int sym=RtfFontNumber("Symbol");
158  fprintRTF("{\\f%d\\'%s}",sym,s);
159  return;
160  }
161  if (index + 128 == 0x9E) { /* U+8359 PESETA SIGN */
162 /* fprintRTF("TRANSLATION");*/
163  return;
164  }
165  if (index + 128 == 0xA9) { /* U+8976 REVERSED NOT SIGN */
166 /* fprintRTF("TRANSLATION");*/
167  return;
168  }
169  if (index + 128 == 0xB0) { /* U+9617 LIGHT SHADE */
170 /* fprintRTF("TRANSLATION");*/
171  return;
172  }
173  if (index + 128 == 0xB1) { /* U+9618 MEDIUM SHADE */
174 /* fprintRTF("TRANSLATION");*/
175  return;
176  }
177  if (index + 128 == 0xB2) { /* U+9619 DARK SHADE */
178 /* fprintRTF("TRANSLATION");*/
179  return;
180  }
181  if (index + 128 == 0xDB) { /* U+9608 FULL BLOCK */
182 /* fprintRTF("TRANSLATION");*/
183  return;
184  }
185  if (index + 128 == 0xDC) { /* U+9604 LOWER HALF BLOCK */
186 /* fprintRTF("TRANSLATION");*/
187  return;
188  }
189  if (index + 128 == 0xDD) { /* U+9612 LEFT HALF BLOCK */
190 /* fprintRTF("TRANSLATION");*/
191  return;
192  }
193  if (index + 128 == 0xDE) { /* U+9616 RIGHT HALF BLOCK */
194 /* fprintRTF("TRANSLATION");*/
195  return;
196  }
197  if (index + 128 == 0xDF) { /* U+9600 UPPER HALF BLOCK */
198 /* fprintRTF("TRANSLATION");*/
199  return;
200  }
201  if (index + 128 == 0xF8) { /* U+8728 RING OPERATOR */
202 /* fprintRTF("TRANSLATION");*/
203  return;
204  }
205  if (index + 128 == 0xFA) { /* U+8729 BULLET OPERATOR */
206 /* fprintRTF("TRANSLATION");*/
207  return;
208  }
209  if (index + 128 == 0xFC) { /* U+8319 SUPERSCRIPT LATIN SMALL LETTER N */
210  fprintRTF("{\\up6 n}");
211  return;
212  }
213  if (index + 128 == 0xFE) { /* U+9632 BLACK SQUARE */
214 /* fprintRTF("TRANSLATION");*/
215  return;
216  }
217 }
218 
219 static void cp850_enc(int index)
220 {
221 char *s;
222  s = cp850_2_ansi[index];
223  if (s[0]!='0'){
224  fprintRTF("\\'%s",s);
225  return;
226  }
227  s = cp850_2_sym[index];
228  if (s[0]!='0'){
229  int sym=RtfFontNumber("Symbol");
230  fprintRTF("{\\f%d\\'%s}",sym,s);
231  return;
232  }
233  if (index + 128 == 0xB0) { /* U+9617 LIGHT SHADE */
234 /* fprintRTF("TRANSLATION");*/
235  return;
236  }
237  if (index + 128 == 0xB1) { /* U+9618 MEDIUM SHADE */
238 /* fprintRTF("TRANSLATION");*/
239  return;
240  }
241  if (index + 128 == 0xB2) { /* U+9619 DARK SHADE */
242 /* fprintRTF("TRANSLATION");*/
243  return;
244  }
245  if (index + 128 == 0xD5) { /* U+305 LATIN SMALL LETTER DOTLESS I */
246  fprintRTF("i");
247  return;
248  }
249  if (index + 128 == 0xDB) { /* U+9608 FULL BLOCK */
250 /* fprintRTF("TRANSLATION");*/
251  return;
252  }
253  if (index + 128 == 0xDC) { /* U+9604 LOWER HALF BLOCK */
254 /* fprintRTF("TRANSLATION");*/
255  return;
256  }
257  if (index + 128 == 0xDF) { /* U+9600 UPPER HALF BLOCK */
258 /* fprintRTF("TRANSLATION");*/
259  return;
260  }
261  if (index + 128 == 0xF7) { /* U+731 OGONEK */
262 /* fprintRTF("TRANSLATION");*/
263  return;
264  }
265  if (index + 128 == 0xFA) { /* U+729 DOT ABOVE */
266  put_dot_char(' ');
267  return;
268  }
269  if (index + 128 == 0xFE) { /* U+9632 BLACK SQUARE */
270 /* fprintRTF("TRANSLATION");*/
271  return;
272  }
273 }
274 
275 static void cp852_enc(int index)
276 {
277 char *s;
278  s = cp852_2_ansi[index];
279  if (s[0]!='0'){
280  fprintRTF("\\'%s",s);
281  return;
282  }
283  s = cp852_2_sym[index];
284  if (s[0]!='0'){
285  int sym=RtfFontNumber("Symbol");
286  fprintRTF("{\\f%d\\'%s}",sym,s);
287  return;
288  }
289  if (index + 128 == 0x85) { /* U+367 LATIN SMALL LETTER U WITH RING ABOVE */
290  put_ring_char('u');
291  return;
292  }
293  if (index + 128 == 0x86) { /* U+263 LATIN SMALL LETTER C WITH ACUTE */
294  put_acute_char('c');
295  return;
296  }
297  if (index + 128 == 0x88) { /* U+322 LATIN SMALL LETTER L WITH STROKE */
298 /* fprintRTF("TRANSLATION");*/
299  return;
300  }
301  if (index + 128 == 0x8A) { /* U+336 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */
302 /* fprintRTF("TRANSLATION");*/
303  return;
304  }
305  if (index + 128 == 0x8B) { /* U+337 LATIN SMALL LETTER O WITH DOUBLE ACUTE */
306 /* fprintRTF("TRANSLATION");*/
307  return;
308  }
309  if (index + 128 == 0x8D) { /* U+377 LATIN CAPITAL LETTER Z WITH ACUTE */
310  put_acute_char('Z');
311  return;
312  }
313  if (index + 128 == 0x8F) { /* U+262 LATIN CAPITAL LETTER C WITH ACUTE */
314  put_acute_char('C');
315  return;
316  }
317  if (index + 128 == 0x91) { /* U+313 LATIN CAPITAL LETTER L WITH ACUTE */
318  put_acute_char('L');
319  return;
320  }
321  if (index + 128 == 0x92) { /* U+314 LATIN SMALL LETTER L WITH ACUTE */
322  put_acute_char('l');
323  return;
324  }
325  if (index + 128 == 0x95) { /* U+317 LATIN CAPITAL LETTER L WITH CARON */
326 /* fprintRTF("TRANSLATION");*/
327  return;
328  }
329  if (index + 128 == 0x96) { /* U+318 LATIN SMALL LETTER L WITH CARON */
330 /* fprintRTF("TRANSLATION");*/
331  return;
332  }
333  if (index + 128 == 0x97) { /* U+346 LATIN CAPITAL LETTER S WITH ACUTE */
334  put_acute_char('S');
335  return;
336  }
337  if (index + 128 == 0x98) { /* U+347 LATIN SMALL LETTER S WITH ACUTE */
338  put_acute_char('s');
339  return;
340  }
341  if (index + 128 == 0x9B) { /* U+356 LATIN CAPITAL LETTER T WITH CARON */
342 /* fprintRTF("TRANSLATION");*/
343  return;
344  }
345  if (index + 128 == 0x9C) { /* U+357 LATIN SMALL LETTER T WITH CARON */
346 /* fprintRTF("TRANSLATION");*/
347  return;
348  }
349  if (index + 128 == 0x9D) { /* U+321 LATIN CAPITAL LETTER L WITH STROKE */
350 /* fprintRTF("TRANSLATION");*/
351  return;
352  }
353  if (index + 128 == 0x9F) { /* U+269 LATIN SMALL LETTER C WITH CARON */
354 /* fprintRTF("TRANSLATION");*/
355  return;
356  }
357  if (index + 128 == 0xA4) { /* U+260 LATIN CAPITAL LETTER A WITH OGONEK */
358 /* fprintRTF("TRANSLATION");*/
359  return;
360  }
361  if (index + 128 == 0xA5) { /* U+261 LATIN SMALL LETTER A WITH OGONEK */
362 /* fprintRTF("TRANSLATION");*/
363  return;
364  }
365  if (index + 128 == 0xA6) { /* U+381 LATIN CAPITAL LETTER Z WITH CARON */
366 /* fprintRTF("TRANSLATION");*/
367  return;
368  }
369  if (index + 128 == 0xA7) { /* U+382 LATIN SMALL LETTER Z WITH CARON */
370 /* fprintRTF("TRANSLATION");*/
371  return;
372  }
373  if (index + 128 == 0xA8) { /* U+280 LATIN CAPITAL LETTER E WITH OGONEK */
374 /* fprintRTF("TRANSLATION");*/
375  return;
376  }
377  if (index + 128 == 0xA9) { /* U+281 LATIN SMALL LETTER E WITH OGONEK */
378 /* fprintRTF("TRANSLATION");*/
379  return;
380  }
381  if (index + 128 == 0xAA) { /* U+65535 unknown */
382 /* fprintRTF("TRANSLATION");*/
383  return;
384  }
385  if (index + 128 == 0xAB) { /* U+378 LATIN SMALL LETTER Z WITH ACUTE */
386  put_acute_char('z');
387  return;
388  }
389  if (index + 128 == 0xAC) { /* U+268 LATIN CAPITAL LETTER C WITH CARON */
390 /* fprintRTF("TRANSLATION");*/
391  return;
392  }
393  if (index + 128 == 0xAD) { /* U+351 LATIN SMALL LETTER S WITH CEDILLA */
394  put_cedilla_char('s');
395  return;
396  }
397  if (index + 128 == 0xB0) { /* U+9617 LIGHT SHADE */
398 /* fprintRTF("TRANSLATION");*/
399  return;
400  }
401  if (index + 128 == 0xB1) { /* U+9618 MEDIUM SHADE */
402 /* fprintRTF("TRANSLATION");*/
403  return;
404  }
405  if (index + 128 == 0xB2) { /* U+9619 DARK SHADE */
406 /* fprintRTF("TRANSLATION");*/
407  return;
408  }
409  if (index + 128 == 0xB7) { /* U+282 LATIN CAPITAL LETTER E WITH CARON */
410 /* fprintRTF("TRANSLATION");*/
411  return;
412  }
413  if (index + 128 == 0xB8) { /* U+350 LATIN CAPITAL LETTER S WITH CEDILLA */
414  put_cedilla_char('S');
415  return;
416  }
417  if (index + 128 == 0xBD) { /* U+379 LATIN CAPITAL LETTER Z WITH DOT ABOVE */
418  put_dot_char('Z');
419  return;
420  }
421  if (index + 128 == 0xBE) { /* U+380 LATIN SMALL LETTER Z WITH DOT ABOVE */
422  put_dot_char('z');
423  return;
424  }
425  if (index + 128 == 0xC6) { /* U+258 LATIN CAPITAL LETTER A WITH BREVE */
426  put_breve_char('A');
427  return;
428  }
429  if (index + 128 == 0xC7) { /* U+259 LATIN SMALL LETTER A WITH BREVE */
430  put_breve_char('a');
431  return;
432  }
433  if (index + 128 == 0xD0) { /* U+273 LATIN SMALL LETTER D WITH STROKE */
434 /* fprintRTF("TRANSLATION");*/
435  return;
436  }
437  if (index + 128 == 0xD1) { /* U+272 LATIN CAPITAL LETTER D WITH STROKE */
438 /* fprintRTF("TRANSLATION");*/
439  return;
440  }
441  if (index + 128 == 0xD2) { /* U+270 LATIN CAPITAL LETTER D WITH CARON */
442 /* fprintRTF("TRANSLATION");*/
443  return;
444  }
445  if (index + 128 == 0xD4) { /* U+271 LATIN SMALL LETTER D WITH CARON */
446 /* fprintRTF("TRANSLATION");*/
447  return;
448  }
449  if (index + 128 == 0xD5) { /* U+327 LATIN CAPITAL LETTER N WITH CARON */
450 /* fprintRTF("TRANSLATION");*/
451  return;
452  }
453  if (index + 128 == 0xD8) { /* U+283 LATIN SMALL LETTER E WITH CARON */
454 /* fprintRTF("TRANSLATION");*/
455  return;
456  }
457  if (index + 128 == 0xDB) { /* U+9608 FULL BLOCK */
458 /* fprintRTF("TRANSLATION");*/
459  return;
460  }
461  if (index + 128 == 0xDC) { /* U+9604 LOWER HALF BLOCK */
462 /* fprintRTF("TRANSLATION");*/
463  return;
464  }
465  if (index + 128 == 0xDD) { /* U+354 LATIN CAPITAL LETTER T WITH CEDILLA */
466  put_cedilla_char('T');
467  return;
468  }
469  if (index + 128 == 0xDE) { /* U+366 LATIN CAPITAL LETTER U WITH RING ABOVE */
470  put_ring_char('U');
471  return;
472  }
473  if (index + 128 == 0xDF) { /* U+9600 UPPER HALF BLOCK */
474 /* fprintRTF("TRANSLATION");*/
475  return;
476  }
477  if (index + 128 == 0xE3) { /* U+323 LATIN CAPITAL LETTER N WITH ACUTE */
478  put_acute_char('N');
479  return;
480  }
481  if (index + 128 == 0xE4) { /* U+324 LATIN SMALL LETTER N WITH ACUTE */
482  put_acute_char('n');
483  return;
484  }
485  if (index + 128 == 0xE5) { /* U+328 LATIN SMALL LETTER N WITH CARON */
486 /* fprintRTF("TRANSLATION");*/
487  return;
488  }
489  if (index + 128 == 0xE8) { /* U+340 LATIN CAPITAL LETTER R WITH ACUTE */
490  put_acute_char('R');
491  return;
492  }
493  if (index + 128 == 0xEA) { /* U+341 LATIN SMALL LETTER R WITH ACUTE */
494  put_acute_char('r');
495  return;
496  }
497  if (index + 128 == 0xEB) { /* U+368 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */
498 /* fprintRTF("TRANSLATION");*/
499  return;
500  }
501  if (index + 128 == 0xEE) { /* U+355 LATIN SMALL LETTER T WITH CEDILLA */
502  put_cedilla_char('t');
503  return;
504  }
505  if (index + 128 == 0xF1) { /* U+733 DOUBLE ACUTE ACCENT */
506 /* fprintRTF("TRANSLATION");*/
507  return;
508  }
509  if (index + 128 == 0xF3) { /* U+711 CARON */
510 /* fprintRTF("TRANSLATION");*/
511  return;
512  }
513  if (index + 128 == 0xF4) { /* U+728 BREVE */
514  int num = RtfFontNumber("MT Extra");
515  fprintRTF("{\\f%d\\'28}", num);
516  return;
517  }
518  if (index + 128 == 0xF7) { /* U+731 OGONEK */
519 /* fprintRTF("TRANSLATION");*/
520  return;
521  }
522  if (index + 128 == 0xFA) { /* U+729 DOT ABOVE */
523  put_dot_char(' ');
524  return;
525  }
526  if (index + 128 == 0xFB) { /* U+369 LATIN SMALL LETTER U WITH DOUBLE ACUTE */
527 /* fprintRTF("TRANSLATION");*/
528  return;
529  }
530  if (index + 128 == 0xFC) { /* U+344 LATIN CAPITAL LETTER R WITH CARON */
531 /* fprintRTF("TRANSLATION");*/
532  return;
533  }
534  if (index + 128 == 0xFD) { /* U+345 LATIN SMALL LETTER R WITH CARON */
535 /* fprintRTF("TRANSLATION");*/
536  return;
537  }
538  if (index + 128 == 0xFE) { /* U+9632 BLACK SQUARE */
539 /* fprintRTF("TRANSLATION");*/
540  return;
541  }
542 }
543 
544 static void cp865_enc(int index)
545 {
546 char *s;
547  s = cp865_2_ansi[index];
548  if (s[0]!='0'){
549  fprintRTF("\\'%s",s);
550  return;
551  }
552  s = cp865_2_sym[index];
553  if (s[0]!='0'){
554  int sym=RtfFontNumber("Symbol");
555  fprintRTF("{\\f%d\\'%s}",sym,s);
556  return;
557  }
558  if (index + 128 == 0x9E) { /* U+8359 PESETA SIGN */
559 /* fprintRTF("TRANSLATION");*/
560  return;
561  }
562  if (index + 128 == 0xA9) { /* U+8976 REVERSED NOT SIGN */
563 /* fprintRTF("TRANSLATION");*/
564  return;
565  }
566  if (index + 128 == 0xB0) { /* U+9617 LIGHT SHADE */
567 /* fprintRTF("TRANSLATION");*/
568  return;
569  }
570  if (index + 128 == 0xB1) { /* U+9618 MEDIUM SHADE */
571 /* fprintRTF("TRANSLATION");*/
572  return;
573  }
574  if (index + 128 == 0xB2) { /* U+9619 DARK SHADE */
575 /* fprintRTF("TRANSLATION");*/
576  return;
577  }
578  if (index + 128 == 0xDB) { /* U+9608 FULL BLOCK */
579 /* fprintRTF("TRANSLATION");*/
580  return;
581  }
582  if (index + 128 == 0xDC) { /* U+9604 LOWER HALF BLOCK */
583 /* fprintRTF("TRANSLATION");*/
584  return;
585  }
586  if (index + 128 == 0xDD) { /* U+9612 LEFT HALF BLOCK */
587 /* fprintRTF("TRANSLATION");*/
588  return;
589  }
590  if (index + 128 == 0xDE) { /* U+9616 RIGHT HALF BLOCK */
591 /* fprintRTF("TRANSLATION");*/
592  return;
593  }
594  if (index + 128 == 0xDF) { /* U+9600 UPPER HALF BLOCK */
595 /* fprintRTF("TRANSLATION");*/
596  return;
597  }
598  if (index + 128 == 0xF8) { /* U+8728 RING OPERATOR */
599 /* fprintRTF("TRANSLATION");*/
600  return;
601  }
602  if (index + 128 == 0xFA) { /* U+8729 BULLET OPERATOR */
603 /* fprintRTF("TRANSLATION");*/
604  return;
605  }
606  if (index + 128 == 0xFC) { /* U+8319 SUPERSCRIPT LATIN SMALL LETTER N */
607 /* fprintRTF("TRANSLATION");*/
608  return;
609  }
610  if (index + 128 == 0xFE) { /* U+9632 BLACK SQUARE */
611 /* fprintRTF("TRANSLATION");*/
612  return;
613  }
614 }
615 
616 static void cp1250_enc(int index)
617 {
618 char *s;
619  s = cp1250_2_ansi[index];
620  if (s[0]!='0'){
621  fprintRTF("\\'%s",s);
622  return;
623  }
624  s = cp1250_2_sym[index];
625  if (s[0]!='0'){
626  int sym=RtfFontNumber("Symbol");
627  fprintRTF("{\\f%d\\'%s}",sym,s);
628  return;
629  }
630  if (index + 128 == 0x80) { /* U+65535 unknown */
631 /* fprintRTF("TRANSLATION");*/
632  return;
633  }
634  if (index + 128 == 0x81) { /* U+65535 unknown */
635 /* fprintRTF("TRANSLATION");*/
636  return;
637  }
638  if (index + 128 == 0x83) { /* U+65535 unknown */
639 /* fprintRTF("TRANSLATION");*/
640  return;
641  }
642  if (index + 128 == 0x88) { /* U+65535 unknown */
643 /* fprintRTF("TRANSLATION");*/
644  return;
645  }
646  if (index + 128 == 0x8C) { /* U+346 LATIN CAPITAL LETTER S WITH ACUTE */
647  put_acute_char('S');
648  return;
649  }
650  if (index + 128 == 0x8D) { /* U+356 LATIN CAPITAL LETTER T WITH CARON */
651 /* fprintRTF("TRANSLATION");*/
652  return;
653  }
654  if (index + 128 == 0x8E) { /* U+381 LATIN CAPITAL LETTER Z WITH CARON */
655 /* fprintRTF("TRANSLATION");*/
656  return;
657  }
658  if (index + 128 == 0x8F) { /* U+377 LATIN CAPITAL LETTER Z WITH ACUTE */
659  put_acute_char('Z');
660  return;
661  }
662  if (index + 128 == 0x90) { /* U+65535 unknown */
663 /* fprintRTF("TRANSLATION");*/
664  return;
665  }
666  if (index + 128 == 0x98) { /* U+65535 unknown */
667 /* fprintRTF("TRANSLATION");*/
668  return;
669  }
670  if (index + 128 == 0x9C) { /* U+347 LATIN SMALL LETTER S WITH ACUTE */
671  put_acute_char('s');
672  return;
673  }
674  if (index + 128 == 0x9D) { /* U+357 LATIN SMALL LETTER T WITH CARON */
675 /* fprintRTF("TRANSLATION");*/
676  return;
677  }
678  if (index + 128 == 0x9E) { /* U+382 LATIN SMALL LETTER Z WITH CARON */
679 /* fprintRTF("TRANSLATION");*/
680  return;
681  }
682  if (index + 128 == 0x9F) { /* U+378 LATIN SMALL LETTER Z WITH ACUTE */
683  put_acute_char('z');
684  return;
685  }
686  if (index + 128 == 0xA1) { /* U+711 CARON */
687 /* fprintRTF("TRANSLATION");*/
688  return;
689  }
690  if (index + 128 == 0xA2) { /* U+728 BREVE */
691  int num = RtfFontNumber("MT Extra");
692  fprintRTF("{\\f%d\\'28}", num);
693  return;
694  }
695  if (index + 128 == 0xA3) { /* U+321 LATIN CAPITAL LETTER L WITH STROKE */
696 /* fprintRTF("TRANSLATION");*/
697  return;
698  }
699  if (index + 128 == 0xA5) { /* U+260 LATIN CAPITAL LETTER A WITH OGONEK */
700 /* fprintRTF("TRANSLATION");*/
701  return;
702  }
703  if (index + 128 == 0xAA) { /* U+350 LATIN CAPITAL LETTER S WITH CEDILLA */
704  put_cedilla_char('S');
705  return;
706  }
707  if (index + 128 == 0xAC) { /* U+65535 unknown */
708 /* fprintRTF("TRANSLATION");*/
709  return;
710  }
711  if (index + 128 == 0xAF) { /* U+379 LATIN CAPITAL LETTER Z WITH DOT ABOVE */
712  put_dot_char('Z');
713  return;
714  }
715  if (index + 128 == 0xB2) { /* U+731 OGONEK */
716 /* fprintRTF("TRANSLATION");*/
717  return;
718  }
719  if (index + 128 == 0xB3) { /* U+322 LATIN SMALL LETTER L WITH STROKE */
720 /* fprintRTF("TRANSLATION");*/
721  return;
722  }
723  if (index + 128 == 0xB9) { /* U+261 LATIN SMALL LETTER A WITH OGONEK */
724 /* fprintRTF("TRANSLATION");*/
725  return;
726  }
727  if (index + 128 == 0xBA) { /* U+351 LATIN SMALL LETTER S WITH CEDILLA */
728  put_cedilla_char('s');
729  return;
730  }
731  if (index + 128 == 0xBC) { /* U+317 LATIN CAPITAL LETTER L WITH CARON */
732 /* fprintRTF("TRANSLATION");*/
733  return;
734  }
735  if (index + 128 == 0xBD) { /* U+733 DOUBLE ACUTE ACCENT */
736 /* fprintRTF("TRANSLATION");*/
737  return;
738  }
739  if (index + 128 == 0xBE) { /* U+318 LATIN SMALL LETTER L WITH CARON */
740 /* fprintRTF("TRANSLATION");*/
741  return;
742  }
743  if (index + 128 == 0xBF) { /* U+380 LATIN SMALL LETTER Z WITH DOT ABOVE */
744  put_dot_char('z');
745  return;
746  }
747  if (index + 128 == 0xC0) { /* U+340 LATIN CAPITAL LETTER R WITH ACUTE */
748  put_acute_char('R');
749  return;
750  }
751  if (index + 128 == 0xC3) { /* U+258 LATIN CAPITAL LETTER A WITH BREVE */
752  put_breve_char('A');
753  return;
754  }
755  if (index + 128 == 0xC5) { /* U+313 LATIN CAPITAL LETTER L WITH ACUTE */
756  put_acute_char('L');
757  return;
758  }
759  if (index + 128 == 0xC6) { /* U+262 LATIN CAPITAL LETTER C WITH ACUTE */
760  put_acute_char('C');
761  return;
762  }
763  if (index + 128 == 0xC8) { /* U+268 LATIN CAPITAL LETTER C WITH CARON */
764 /* fprintRTF("TRANSLATION");*/
765  return;
766  }
767  if (index + 128 == 0xCA) { /* U+280 LATIN CAPITAL LETTER E WITH OGONEK */
768 /* fprintRTF("TRANSLATION");*/
769  return;
770  }
771  if (index + 128 == 0xCC) { /* U+282 LATIN CAPITAL LETTER E WITH CARON */
772 /* fprintRTF("TRANSLATION");*/
773  return;
774  }
775  if (index + 128 == 0xCF) { /* U+270 LATIN CAPITAL LETTER D WITH CARON */
776 /* fprintRTF("TRANSLATION");*/
777  return;
778  }
779  if (index + 128 == 0xD0) { /* U+272 LATIN CAPITAL LETTER D WITH STROKE */
780 /* fprintRTF("TRANSLATION");*/
781  return;
782  }
783  if (index + 128 == 0xD1) { /* U+323 LATIN CAPITAL LETTER N WITH ACUTE */
784  put_acute_char('N');
785  return;
786  }
787  if (index + 128 == 0xD2) { /* U+327 LATIN CAPITAL LETTER N WITH CARON */
788 /* fprintRTF("TRANSLATION");*/
789  return;
790  }
791  if (index + 128 == 0xD5) { /* U+336 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */
792 /* fprintRTF("TRANSLATION");*/
793  return;
794  }
795  if (index + 128 == 0xD8) { /* U+344 LATIN CAPITAL LETTER R WITH CARON */
796 /* fprintRTF("TRANSLATION");*/
797  return;
798  }
799  if (index + 128 == 0xD9) { /* U+366 LATIN CAPITAL LETTER U WITH RING ABOVE */
800  put_ring_char('U');
801  return;
802  }
803  if (index + 128 == 0xDB) { /* U+368 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */
804 /* fprintRTF("TRANSLATION");*/
805  return;
806  }
807  if (index + 128 == 0xDE) { /* U+354 LATIN CAPITAL LETTER T WITH CEDILLA */
808  put_cedilla_char('T');
809  return;
810  }
811  if (index + 128 == 0xE0) { /* U+341 LATIN SMALL LETTER R WITH ACUTE */
812  put_acute_char('r');
813  return;
814  }
815  if (index + 128 == 0xE3) { /* U+259 LATIN SMALL LETTER A WITH BREVE */
816  put_breve_char('a');
817  return;
818  }
819  if (index + 128 == 0xE5) { /* U+314 LATIN SMALL LETTER L WITH ACUTE */
820  put_acute_char('l');
821  return;
822  }
823  if (index + 128 == 0xE6) { /* U+263 LATIN SMALL LETTER C WITH ACUTE */
824  put_acute_char('c');
825  return;
826  }
827  if (index + 128 == 0xE8) { /* U+269 LATIN SMALL LETTER C WITH CARON */
828 /* fprintRTF("TRANSLATION");*/
829  return;
830  }
831  if (index + 128 == 0xEA) { /* U+281 LATIN SMALL LETTER E WITH OGONEK */
832 /* fprintRTF("TRANSLATION");*/
833  return;
834  }
835  if (index + 128 == 0xEC) { /* U+283 LATIN SMALL LETTER E WITH CARON */
836 /* fprintRTF("TRANSLATION");*/
837  return;
838  }
839  if (index + 128 == 0xEF) { /* U+271 LATIN SMALL LETTER D WITH CARON */
840 /* fprintRTF("TRANSLATION");*/
841  return;
842  }
843  if (index + 128 == 0xF0) { /* U+273 LATIN SMALL LETTER D WITH STROKE */
844 /* fprintRTF("TRANSLATION");*/
845  return;
846  }
847  if (index + 128 == 0xF1) { /* U+324 LATIN SMALL LETTER N WITH ACUTE */
848  put_acute_char('n');
849  return;
850  }
851  if (index + 128 == 0xF2) { /* U+328 LATIN SMALL LETTER N WITH CARON */
852 /* fprintRTF("TRANSLATION");*/
853  return;
854  }
855  if (index + 128 == 0xF5) { /* U+337 LATIN SMALL LETTER O WITH DOUBLE ACUTE */
856 /* fprintRTF("TRANSLATION");*/
857  return;
858  }
859  if (index + 128 == 0xF8) { /* U+345 LATIN SMALL LETTER R WITH CARON */
860 /* fprintRTF("TRANSLATION");*/
861  return;
862  }
863  if (index + 128 == 0xF9) { /* U+367 LATIN SMALL LETTER U WITH RING ABOVE */
864  put_ring_char('u');
865  return;
866  }
867  if (index + 128 == 0xFB) { /* U+369 LATIN SMALL LETTER U WITH DOUBLE ACUTE */
868 /* fprintRTF("TRANSLATION");*/
869  return;
870  }
871  if (index + 128 == 0xFE) { /* U+355 LATIN SMALL LETTER T WITH CEDILLA */
872  put_cedilla_char('t');
873  return;
874  }
875  if (index + 128 == 0xFF) { /* U+729 DOT ABOVE */
876  put_dot_char(' ');
877  return;
878  }
879 }
880 
881 static void cp1252_enc(int index)
882 {
883 char *s;
884  s = cp1252_2_ansi[index];
885  if (s[0]!='0'){
886  fprintRTF("\\'%s",s);
887  return;
888  }
889  s = cp1252_2_sym[index];
890  if (s[0]!='0'){
891  int sym=RtfFontNumber("Symbol");
892  fprintRTF("{\\f%d\\'%s}",sym,s);
893  return;
894  }
895  if (index + 128 == 0x80) { /* U+65535 unknown */
896 /* fprintRTF("TRANSLATION");*/
897  return;
898  }
899  if (index + 128 == 0x81) { /* U+65535 unknown */
900 /* fprintRTF("TRANSLATION");*/
901  return;
902  }
903  if (index + 128 == 0x8D) { /* U+65535 unknown */
904 /* fprintRTF("TRANSLATION");*/
905  return;
906  }
907  if (index + 128 == 0x8E) { /* U+65535 unknown */
908 /* fprintRTF("TRANSLATION");*/
909  return;
910  }
911  if (index + 128 == 0x8F) { /* U+65535 unknown */
912 /* fprintRTF("TRANSLATION");*/
913  return;
914  }
915  if (index + 128 == 0x90) { /* U+65535 unknown */
916 /* fprintRTF("TRANSLATION");*/
917  return;
918  }
919  if (index + 128 == 0x9D) { /* U+65535 unknown */
920 /* fprintRTF("TRANSLATION");*/
921  return;
922  }
923  if (index + 128 == 0x9E) { /* U+65535 unknown */
924 /* fprintRTF("TRANSLATION");*/
925  return;
926  }
927 }
928 
929 static void decmulti_enc(int index)
930 {
931 char *s;
933  if (s[0]!='0'){
934  fprintRTF("\\'%s",s);
935  return;
936  }
938  if (s[0]!='0'){
939  int sym=RtfFontNumber("Symbol");
940  fprintRTF("{\\f%d\\'%s}",sym,s);
941  return;
942  }
943  if (index + 128 == 0xA0) { /* U+65535 unknown */
944 /* fprintRTF("TRANSLATION");*/
945  return;
946  }
947  if (index + 128 == 0xA4) { /* U+65535 unknown */
948 /* fprintRTF("TRANSLATION");*/
949  return;
950  }
951  if (index + 128 == 0xA6) { /* U+65535 unknown */
952 /* fprintRTF("TRANSLATION");*/
953  return;
954  }
955  if (index + 128 == 0xAC) { /* U+65535 unknown */
956 /* fprintRTF("TRANSLATION");*/
957  return;
958  }
959  if (index + 128 == 0xAD) { /* U+65535 unknown */
960 /* fprintRTF("TRANSLATION");*/
961  return;
962  }
963  if (index + 128 == 0xAE) { /* U+65535 unknown */
964 /* fprintRTF("TRANSLATION");*/
965  return;
966  }
967  if (index + 128 == 0xAF) { /* U+65535 unknown */
968 /* fprintRTF("TRANSLATION");*/
969  return;
970  }
971  if (index + 128 == 0xB4) { /* U+65535 unknown */
972 /* fprintRTF("TRANSLATION");*/
973  return;
974  }
975  if (index + 128 == 0xB8) { /* U+65535 unknown */
976 /* fprintRTF("TRANSLATION");*/
977  return;
978  }
979  if (index + 128 == 0xBE) { /* U+65535 unknown */
980 /* fprintRTF("TRANSLATION");*/
981  return;
982  }
983  if (index + 128 == 0xD0) { /* U+65535 unknown */
984 /* fprintRTF("TRANSLATION");*/
985  return;
986  }
987  if (index + 128 == 0xDE) { /* U+65535 unknown */
988 /* fprintRTF("TRANSLATION");*/
989  return;
990  }
991  if (index + 128 == 0xF0) { /* U+65535 unknown */
992 /* fprintRTF("TRANSLATION");*/
993  return;
994  }
995  if (index + 128 == 0xFE) { /* U+65535 unknown */
996 /* fprintRTF("TRANSLATION");*/
997  return;
998  }
999  if (index + 128 == 0xFF) { /* U+65535 unknown */
1000 /* fprintRTF("TRANSLATION");*/
1001  return;
1002  }
1003 }
1004 
1005 static void latin1_enc(int index)
1006 {
1007 char *s;
1008  s = latin1_2_ansi[index];
1009  if (s[0]!='0'){
1010  fprintRTF("\\'%s",s);
1011  return;
1012  }
1013  s = latin1_2_sym[index];
1014  if (s[0]!='0'){
1015  int sym=RtfFontNumber("Symbol");
1016  fprintRTF("{\\f%d\\'%s}",sym,s);
1017  return;
1018  }
1019 }
1020 
1021 static void latin2_enc(int index)
1022 {
1023 char *s;
1024  s = latin2_2_ansi[index];
1025  if (s[0]!='0'){
1026  fprintRTF("\\'%s",s);
1027  return;
1028  }
1029  s = latin2_2_sym[index];
1030  if (s[0]!='0'){
1031  int sym=RtfFontNumber("Symbol");
1032  fprintRTF("{\\f%d\\'%s}",sym,s);
1033  return;
1034  }
1035  if (index + 128 == 0xA1) { /* U+260 LATIN CAPITAL LETTER A WITH OGONEK */
1036 /* fprintRTF("TRANSLATION");*/
1037  return;
1038  }
1039  if (index + 128 == 0xA2) { /* U+728 BREVE */
1040  int num = RtfFontNumber("MT Extra");
1041  fprintRTF("{\\f%d\\'28}", num);
1042  return;
1043  }
1044  if (index + 128 == 0xA3) { /* U+321 LATIN CAPITAL LETTER L WITH STROKE */
1045 /* fprintRTF("TRANSLATION");*/
1046  return;
1047  }
1048  if (index + 128 == 0xA5) { /* U+317 LATIN CAPITAL LETTER L WITH CARON */
1049 /* fprintRTF("TRANSLATION");*/
1050  return;
1051  }
1052  if (index + 128 == 0xA6) { /* U+346 LATIN CAPITAL LETTER S WITH ACUTE */
1053  put_acute_char('S');
1054  return;
1055  }
1056  if (index + 128 == 0xAA) { /* U+350 LATIN CAPITAL LETTER S WITH CEDILLA */
1057  put_cedilla_char('S');
1058  return;
1059  }
1060  if (index + 128 == 0xAB) { /* U+356 LATIN CAPITAL LETTER T WITH CARON */
1061 /* fprintRTF("TRANSLATION");*/
1062  return;
1063  }
1064  if (index + 128 == 0xAC) { /* U+377 LATIN CAPITAL LETTER Z WITH ACUTE */
1065  put_acute_char('Z');
1066  return;
1067  }
1068  if (index + 128 == 0xAE) { /* U+381 LATIN CAPITAL LETTER Z WITH CARON */
1069 /* fprintRTF("TRANSLATION");*/
1070  return;
1071  }
1072  if (index + 128 == 0xAF) { /* U+379 LATIN CAPITAL LETTER Z WITH DOT ABOVE */
1073  put_dot_char('Z');
1074  return;
1075  }
1076  if (index + 128 == 0xB1) { /* U+261 LATIN SMALL LETTER A WITH OGONEK */
1077 /* fprintRTF("TRANSLATION");*/
1078  return;
1079  }
1080  if (index + 128 == 0xB2) { /* U+731 OGONEK */
1081 /* fprintRTF("TRANSLATION");*/
1082  return;
1083  }
1084  if (index + 128 == 0xB3) { /* U+322 LATIN SMALL LETTER L WITH STROKE */
1085 /* fprintRTF("TRANSLATION");*/
1086  return;
1087  }
1088  if (index + 128 == 0xB5) { /* U+318 LATIN SMALL LETTER L WITH CARON */
1089 /* fprintRTF("TRANSLATION");*/
1090  return;
1091  }
1092  if (index + 128 == 0xB6) { /* U+347 LATIN SMALL LETTER S WITH ACUTE */
1093  put_acute_char('s');
1094  return;
1095  }
1096  if (index + 128 == 0xB7) { /* U+711 CARON */
1097 /* fprintRTF("TRANSLATION");*/
1098  return;
1099  }
1100  if (index + 128 == 0xBA) { /* U+351 LATIN SMALL LETTER S WITH CEDILLA */
1101  put_cedilla_char('s');
1102  return;
1103  }
1104  if (index + 128 == 0xBB) { /* U+357 LATIN SMALL LETTER T WITH CARON */
1105 /* fprintRTF("TRANSLATION");*/
1106  return;
1107  }
1108  if (index + 128 == 0xBC) { /* U+378 LATIN SMALL LETTER Z WITH ACUTE */
1109  put_acute_char('z');
1110  return;
1111  }
1112  if (index + 128 == 0xBD) { /* U+733 DOUBLE ACUTE ACCENT */
1113 /* fprintRTF("TRANSLATION");*/
1114  return;
1115  }
1116  if (index + 128 == 0xBE) { /* U+382 LATIN SMALL LETTER Z WITH CARON */
1117 /* fprintRTF("TRANSLATION");*/
1118  return;
1119  }
1120  if (index + 128 == 0xBF) { /* U+380 LATIN SMALL LETTER Z WITH DOT ABOVE */
1121  put_dot_char('z');
1122  return;
1123  }
1124  if (index + 128 == 0xC0) { /* U+340 LATIN CAPITAL LETTER R WITH ACUTE */
1125  put_acute_char('R');
1126  return;
1127  }
1128  if (index + 128 == 0xC3) { /* U+258 LATIN CAPITAL LETTER A WITH BREVE */
1129  put_breve_char('A');
1130  return;
1131  }
1132  if (index + 128 == 0xC5) { /* U+313 LATIN CAPITAL LETTER L WITH ACUTE */
1133  put_acute_char('L');
1134  return;
1135  }
1136  if (index + 128 == 0xC6) { /* U+262 LATIN CAPITAL LETTER C WITH ACUTE */
1137  put_acute_char('C');
1138  return;
1139  }
1140  if (index + 128 == 0xC8) { /* U+268 LATIN CAPITAL LETTER C WITH CARON */
1141 /* fprintRTF("TRANSLATION");*/
1142  return;
1143  }
1144  if (index + 128 == 0xCA) { /* U+280 LATIN CAPITAL LETTER E WITH OGONEK */
1145 /* fprintRTF("TRANSLATION");*/
1146  return;
1147  }
1148  if (index + 128 == 0xCC) { /* U+282 LATIN CAPITAL LETTER E WITH CARON */
1149 /* fprintRTF("TRANSLATION");*/
1150  return;
1151  }
1152  if (index + 128 == 0xCF) { /* U+270 LATIN CAPITAL LETTER D WITH CARON */
1153 /* fprintRTF("TRANSLATION");*/
1154  return;
1155  }
1156  if (index + 128 == 0xD0) { /* U+272 LATIN CAPITAL LETTER D WITH STROKE */
1157 /* fprintRTF("TRANSLATION");*/
1158  return;
1159  }
1160  if (index + 128 == 0xD1) { /* U+323 LATIN CAPITAL LETTER N WITH ACUTE */
1161  put_acute_char('N');
1162  return;
1163  }
1164  if (index + 128 == 0xD2) { /* U+327 LATIN CAPITAL LETTER N WITH CARON */
1165 /* fprintRTF("TRANSLATION");*/
1166  return;
1167  }
1168  if (index + 128 == 0xD5) { /* U+336 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */
1169 /* fprintRTF("TRANSLATION");*/
1170  return;
1171  }
1172  if (index + 128 == 0xD8) { /* U+344 LATIN CAPITAL LETTER R WITH CARON */
1173 /* fprintRTF("TRANSLATION");*/
1174  return;
1175  }
1176  if (index + 128 == 0xD9) { /* U+366 LATIN CAPITAL LETTER U WITH RING ABOVE */
1177  put_ring_char('U');
1178  return;
1179  }
1180  if (index + 128 == 0xDB) { /* U+368 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */
1181 /* fprintRTF("TRANSLATION");*/
1182  return;
1183  }
1184  if (index + 128 == 0xDE) { /* U+354 LATIN CAPITAL LETTER T WITH CEDILLA */
1185  put_cedilla_char('T');
1186  return;
1187  }
1188  if (index + 128 == 0xE0) { /* U+341 LATIN SMALL LETTER R WITH ACUTE */
1189  put_acute_char('r');
1190  return;
1191  }
1192  if (index + 128 == 0xE3) { /* U+259 LATIN SMALL LETTER A WITH BREVE */
1193  put_breve_char('a');
1194  return;
1195  }
1196  if (index + 128 == 0xE5) { /* U+314 LATIN SMALL LETTER L WITH ACUTE */
1197  put_acute_char('l');
1198  return;
1199  }
1200  if (index + 128 == 0xE6) { /* U+263 LATIN SMALL LETTER C WITH ACUTE */
1201  put_acute_char('c');
1202  return;
1203  }
1204  if (index + 128 == 0xE8) { /* U+269 LATIN SMALL LETTER C WITH CARON */
1205 /* fprintRTF("TRANSLATION");*/
1206  return;
1207  }
1208  if (index + 128 == 0xEA) { /* U+281 LATIN SMALL LETTER E WITH OGONEK */
1209 /* fprintRTF("TRANSLATION");*/
1210  return;
1211  }
1212  if (index + 128 == 0xEC) { /* U+283 LATIN SMALL LETTER E WITH CARON */
1213 /* fprintRTF("TRANSLATION");*/
1214  return;
1215  }
1216  if (index + 128 == 0xEF) { /* U+271 LATIN SMALL LETTER D WITH CARON */
1217 /* fprintRTF("TRANSLATION");*/
1218  return;
1219  }
1220  if (index + 128 == 0xF0) { /* U+273 LATIN SMALL LETTER D WITH STROKE */
1221 /* fprintRTF("TRANSLATION");*/
1222  return;
1223  }
1224  if (index + 128 == 0xF1) { /* U+324 LATIN SMALL LETTER N WITH ACUTE */
1225  put_acute_char('n');
1226  return;
1227  }
1228  if (index + 128 == 0xF2) { /* U+328 LATIN SMALL LETTER N WITH CARON */
1229 /* fprintRTF("TRANSLATION");*/
1230  return;
1231  }
1232  if (index + 128 == 0xF5) { /* U+337 LATIN SMALL LETTER O WITH DOUBLE ACUTE */
1233 /* fprintRTF("TRANSLATION");*/
1234  return;
1235  }
1236  if (index + 128 == 0xF8) { /* U+345 LATIN SMALL LETTER R WITH CARON */
1237 /* fprintRTF("TRANSLATION");*/
1238  return;
1239  }
1240  if (index + 128 == 0xF9) { /* U+367 LATIN SMALL LETTER U WITH RING ABOVE */
1241  put_ring_char('u');
1242  return;
1243  }
1244  if (index + 128 == 0xFB) { /* U+369 LATIN SMALL LETTER U WITH DOUBLE ACUTE */
1245 /* fprintRTF("TRANSLATION");*/
1246  return;
1247  }
1248  if (index + 128 == 0xFE) { /* U+355 LATIN SMALL LETTER T WITH CEDILLA */
1249  put_cedilla_char('t');
1250  return;
1251  }
1252  if (index + 128 == 0xFF) { /* U+729 DOT ABOVE */
1253  put_dot_char(' ');
1254  return;
1255  }
1256 }
1257 
1258 static void latin3_enc(int index)
1259 {
1260 char *s;
1261  s = latin3_2_ansi[index];
1262  if (s[0]!='0'){
1263  fprintRTF("\\'%s",s);
1264  return;
1265  }
1266  s = latin3_2_sym[index];
1267  if (s[0]!='0'){
1268  int sym=RtfFontNumber("Symbol");
1269  fprintRTF("{\\f%d\\'%s}",sym,s);
1270  return;
1271  }
1272  if (index + 128 == 0xA1) { /* U+294 LATIN CAPITAL LETTER H WITH STROKE */
1273 /* fprintRTF("TRANSLATION");*/
1274  return;
1275  }
1276  if (index + 128 == 0xA2) { /* U+728 BREVE */
1277  int num = RtfFontNumber("MT Extra");
1278  fprintRTF("{\\f%d\\'28}", num);
1279  return;
1280  }
1281  if (index + 128 == 0xA5) { /* U+65535 unknown */
1282 /* fprintRTF("TRANSLATION");*/
1283  return;
1284  }
1285  if (index + 128 == 0xA6) { /* U+292 LATIN CAPITAL LETTER H WITH CIRCUMFLEX */
1286 /* fprintRTF("TRANSLATION");*/
1287  return;
1288  }
1289  if (index + 128 == 0xA9) { /* U+304 LATIN CAPITAL LETTER I WITH DOT ABOVE */
1290  put_dot_char('I');
1291  return;
1292  }
1293  if (index + 128 == 0xAA) { /* U+350 LATIN CAPITAL LETTER S WITH CEDILLA */
1294  put_cedilla_char('S');
1295  return;
1296  }
1297  if (index + 128 == 0xAB) { /* U+286 LATIN CAPITAL LETTER G WITH BREVE */
1298  put_breve_char('G');
1299  return;
1300  }
1301  if (index + 128 == 0xAC) { /* U+308 LATIN CAPITAL LETTER J WITH CIRCUMFLEX */
1302 /* fprintRTF("TRANSLATION");*/
1303  return;
1304  }
1305  if (index + 128 == 0xAE) { /* U+65535 unknown */
1306 /* fprintRTF("TRANSLATION");*/
1307  return;
1308  }
1309  if (index + 128 == 0xAF) { /* U+379 LATIN CAPITAL LETTER Z WITH DOT ABOVE */
1310  put_dot_char('Z');
1311  return;
1312  }
1313  if (index + 128 == 0xB1) { /* U+295 LATIN SMALL LETTER H WITH STROKE */
1314 /* fprintRTF("TRANSLATION");*/
1315  return;
1316  }
1317  if (index + 128 == 0xB6) { /* U+293 LATIN SMALL LETTER H WITH CIRCUMFLEX */
1318 /* fprintRTF("TRANSLATION");*/
1319  return;
1320  }
1321  if (index + 128 == 0xB9) { /* U+305 LATIN SMALL LETTER DOTLESS I */
1322  fprintRTF("i");
1323  return;
1324  }
1325  if (index + 128 == 0xBA) { /* U+351 LATIN SMALL LETTER S WITH CEDILLA */
1326  put_cedilla_char('s');
1327  return;
1328  }
1329  if (index + 128 == 0xBB) { /* U+287 LATIN SMALL LETTER G WITH BREVE */
1330  put_breve_char('g');
1331  return;
1332  }
1333  if (index + 128 == 0xBC) { /* U+309 LATIN SMALL LETTER J WITH CIRCUMFLEX */
1334 /* fprintRTF("TRANSLATION");*/
1335  return;
1336  }
1337  if (index + 128 == 0xBE) { /* U+65535 unknown */
1338 /* fprintRTF("TRANSLATION");*/
1339  return;
1340  }
1341  if (index + 128 == 0xBF) { /* U+380 LATIN SMALL LETTER Z WITH DOT ABOVE */
1342  put_dot_char('z');
1343  return;
1344  }
1345  if (index + 128 == 0xC3) { /* U+65535 unknown */
1346 /* fprintRTF("TRANSLATION");*/
1347  return;
1348  }
1349  if (index + 128 == 0xC5) { /* U+266 LATIN CAPITAL LETTER C WITH DOT ABOVE */
1350  put_dot_char('C');
1351  return;
1352  }
1353  if (index + 128 == 0xC6) { /* U+264 LATIN CAPITAL LETTER C WITH CIRCUMFLEX */
1354 /* fprintRTF("TRANSLATION");*/
1355  return;
1356  }
1357  if (index + 128 == 0xD0) { /* U+65535 unknown */
1358 /* fprintRTF("TRANSLATION");*/
1359  return;
1360  }
1361  if (index + 128 == 0xD5) { /* U+288 LATIN CAPITAL LETTER G WITH DOT ABOVE */
1362  put_dot_char('G');
1363  return;
1364  }
1365  if (index + 128 == 0xD8) { /* U+284 LATIN CAPITAL LETTER G WITH CIRCUMFLEX */
1366 /* fprintRTF("TRANSLATION");*/
1367  return;
1368  }
1369  if (index + 128 == 0xDD) { /* U+364 LATIN CAPITAL LETTER U WITH BREVE */
1370  put_breve_char('U');
1371  return;
1372  }
1373  if (index + 128 == 0xDE) { /* U+348 LATIN CAPITAL LETTER S WITH CIRCUMFLEX */
1374 /* fprintRTF("TRANSLATION");*/
1375  return;
1376  }
1377  if (index + 128 == 0xE3) { /* U+65535 unknown */
1378 /* fprintRTF("TRANSLATION");*/
1379  return;
1380  }
1381  if (index + 128 == 0xE5) { /* U+267 LATIN SMALL LETTER C WITH DOT ABOVE */
1382  put_dot_char('c');
1383  return;
1384  }
1385  if (index + 128 == 0xE6) { /* U+265 LATIN SMALL LETTER C WITH CIRCUMFLEX */
1386 /* fprintRTF("TRANSLATION");*/
1387  return;
1388  }
1389  if (index + 128 == 0xF0) { /* U+65535 unknown */
1390 /* fprintRTF("TRANSLATION");*/
1391  return;
1392  }
1393  if (index + 128 == 0xF5) { /* U+289 LATIN SMALL LETTER G WITH DOT ABOVE */
1394  put_dot_char('g');
1395  return;
1396  }
1397  if (index + 128 == 0xF8) { /* U+285 LATIN SMALL LETTER G WITH CIRCUMFLEX */
1398 /* fprintRTF("TRANSLATION");*/
1399  return;
1400  }
1401  if (index + 128 == 0xFD) { /* U+365 LATIN SMALL LETTER U WITH BREVE */
1402  put_breve_char('u');
1403  return;
1404  }
1405  if (index + 128 == 0xFE) { /* U+349 LATIN SMALL LETTER S WITH CIRCUMFLEX */
1406 /* fprintRTF("TRANSLATION");*/
1407  return;
1408  }
1409  if (index + 128 == 0xFF) { /* U+729 DOT ABOVE */
1410  put_dot_char(' ');
1411  return;
1412  }
1413 }
1414 
1415 static void latin4_enc(int index)
1416 {
1417 char *s;
1418  s = latin4_2_ansi[index];
1419  if (s[0]!='0'){
1420  fprintRTF("\\'%s",s);
1421  return;
1422  }
1423  s = latin4_2_sym[index];
1424  if (s[0]!='0'){
1425  int sym=RtfFontNumber("Symbol");
1426  fprintRTF("{\\f%d\\'%s}",sym,s);
1427  return;
1428  }
1429  if (index + 128 == 0xA1) { /* U+260 LATIN CAPITAL LETTER A WITH OGONEK */
1430 /* fprintRTF("TRANSLATION");*/
1431  return;
1432  }
1433  if (index + 128 == 0xA2) { /* U+312 LATIN SMALL LETTER KRA */
1434 /* fprintRTF("TRANSLATION");*/
1435  return;
1436  }
1437  if (index + 128 == 0xA3) { /* U+342 LATIN CAPITAL LETTER R WITH CEDILLA */
1438  put_cedilla_char('R');
1439  return;
1440  }
1441  if (index + 128 == 0xA5) { /* U+296 LATIN CAPITAL LETTER I WITH TILDE */
1442  put_tilde_char('I');
1443  return;
1444  }
1445  if (index + 128 == 0xA6) { /* U+315 LATIN CAPITAL LETTER L WITH CEDILLA */
1446  put_cedilla_char('L');
1447  return;
1448  }
1449  if (index + 128 == 0xAA) { /* U+274 LATIN CAPITAL LETTER E WITH MACRON */
1450  put_macron_char('E');
1451  return;
1452  }
1453  if (index + 128 == 0xAB) { /* U+290 LATIN CAPITAL LETTER G WITH CEDILLA */
1454  put_cedilla_char('G');
1455  return;
1456  }
1457  if (index + 128 == 0xAC) { /* U+358 LATIN CAPITAL LETTER T WITH STROKE */
1458 /* fprintRTF("TRANSLATION");*/
1459  return;
1460  }
1461  if (index + 128 == 0xAE) { /* U+381 LATIN CAPITAL LETTER Z WITH CARON */
1462 /* fprintRTF("TRANSLATION");*/
1463  return;
1464  }
1465  if (index + 128 == 0xB1) { /* U+261 LATIN SMALL LETTER A WITH OGONEK */
1466 /* fprintRTF("TRANSLATION");*/
1467  return;
1468  }
1469  if (index + 128 == 0xB2) { /* U+731 OGONEK */
1470 /* fprintRTF("TRANSLATION");*/
1471  return;
1472  }
1473  if (index + 128 == 0xB3) { /* U+343 LATIN SMALL LETTER R WITH CEDILLA */
1474  put_cedilla_char('r');
1475  return;
1476  }
1477  if (index + 128 == 0xB5) { /* U+297 LATIN SMALL LETTER I WITH TILDE */
1478  put_tilde_char('i');
1479  return;
1480  }
1481  if (index + 128 == 0xB6) { /* U+316 LATIN SMALL LETTER L WITH CEDILLA */
1482  put_cedilla_char('l');
1483  return;
1484  }
1485  if (index + 128 == 0xB7) { /* U+711 CARON */
1486 /* fprintRTF("TRANSLATION");*/
1487  return;
1488  }
1489  if (index + 128 == 0xBA) { /* U+275 LATIN SMALL LETTER E WITH MACRON */
1490  put_macron_char('e');
1491  return;
1492  }
1493  if (index + 128 == 0xBB) { /* U+291 LATIN SMALL LETTER G WITH CEDILLA */
1494  put_cedilla_char('g');
1495  return;
1496  }
1497  if (index + 128 == 0xBC) { /* U+359 LATIN SMALL LETTER T WITH STROKE */
1498 /* fprintRTF("TRANSLATION");*/
1499  return;
1500  }
1501  if (index + 128 == 0xBD) { /* U+330 LATIN CAPITAL LETTER ENG */
1502 /* fprintRTF("TRANSLATION");*/
1503  return;
1504  }
1505  if (index + 128 == 0xBE) { /* U+382 LATIN SMALL LETTER Z WITH CARON */
1506 /* fprintRTF("TRANSLATION");*/
1507  return;
1508  }
1509  if (index + 128 == 0xBF) { /* U+331 LATIN SMALL LETTER ENG */
1510 /* fprintRTF("TRANSLATION");*/
1511  return;
1512  }
1513  if (index + 128 == 0xC0) { /* U+256 LATIN CAPITAL LETTER A WITH MACRON */
1514  put_macron_char('A');
1515  return;
1516  }
1517  if (index + 128 == 0xC7) { /* U+302 LATIN CAPITAL LETTER I WITH OGONEK */
1518 /* fprintRTF("TRANSLATION");*/
1519  return;
1520  }
1521  if (index + 128 == 0xC8) { /* U+268 LATIN CAPITAL LETTER C WITH CARON */
1522 /* fprintRTF("TRANSLATION");*/
1523  return;
1524  }
1525  if (index + 128 == 0xCA) { /* U+280 LATIN CAPITAL LETTER E WITH OGONEK */
1526 /* fprintRTF("TRANSLATION");*/
1527  return;
1528  }
1529  if (index + 128 == 0xCC) { /* U+278 LATIN CAPITAL LETTER E WITH DOT ABOVE */
1530  put_dot_char('E');
1531  return;
1532  }
1533  if (index + 128 == 0xCF) { /* U+298 LATIN CAPITAL LETTER I WITH MACRON */
1534  put_macron_char('I');
1535  return;
1536  }
1537  if (index + 128 == 0xD0) { /* U+272 LATIN CAPITAL LETTER D WITH STROKE */
1538 /* fprintRTF("TRANSLATION");*/
1539  return;
1540  }
1541  if (index + 128 == 0xD1) { /* U+325 LATIN CAPITAL LETTER N WITH CEDILLA */
1542  put_cedilla_char('N');
1543  return;
1544  }
1545  if (index + 128 == 0xD2) { /* U+332 LATIN CAPITAL LETTER O WITH MACRON */
1546  put_macron_char('O');
1547  return;
1548  }
1549  if (index + 128 == 0xD3) { /* U+310 LATIN CAPITAL LETTER K WITH CEDILLA */
1550  put_cedilla_char('K');
1551  return;
1552  }
1553  if (index + 128 == 0xD9) { /* U+370 LATIN CAPITAL LETTER U WITH OGONEK */
1554 /* fprintRTF("TRANSLATION");*/
1555  return;
1556  }
1557  if (index + 128 == 0xDD) { /* U+360 LATIN CAPITAL LETTER U WITH TILDE */
1558  put_tilde_char('U');
1559  return;
1560  }
1561  if (index + 128 == 0xDE) { /* U+362 LATIN CAPITAL LETTER U WITH MACRON */
1562  put_macron_char('U');
1563  return;
1564  }
1565  if (index + 128 == 0xE0) { /* U+257 LATIN SMALL LETTER A WITH MACRON */
1566  put_macron_char('a');
1567  return;
1568  }
1569  if (index + 128 == 0xE7) { /* U+303 LATIN SMALL LETTER I WITH OGONEK */
1570 /* fprintRTF("TRANSLATION");*/
1571  return;
1572  }
1573  if (index + 128 == 0xE8) { /* U+269 LATIN SMALL LETTER C WITH CARON */
1574 /* fprintRTF("TRANSLATION");*/
1575  return;
1576  }
1577  if (index + 128 == 0xEA) { /* U+281 LATIN SMALL LETTER E WITH OGONEK */
1578 /* fprintRTF("TRANSLATION");*/
1579  return;
1580  }
1581  if (index + 128 == 0xEC) { /* U+279 LATIN SMALL LETTER E WITH DOT ABOVE */
1582  put_dot_char('e');
1583  return;
1584  }
1585  if (index + 128 == 0xEF) { /* U+299 LATIN SMALL LETTER I WITH MACRON */
1586  put_macron_char('i');
1587  return;
1588  }
1589  if (index + 128 == 0xF0) { /* U+273 LATIN SMALL LETTER D WITH STROKE */
1590 /* fprintRTF("TRANSLATION");*/
1591  return;
1592  }
1593  if (index + 128 == 0xF1) { /* U+326 LATIN SMALL LETTER N WITH CEDILLA */
1594  put_cedilla_char('n');
1595  return;
1596  }
1597  if (index + 128 == 0xF2) { /* U+333 LATIN SMALL LETTER O WITH MACRON */
1598  put_macron_char('o');
1599  return;
1600  }
1601  if (index + 128 == 0xF3) { /* U+311 LATIN SMALL LETTER K WITH CEDILLA */
1602  put_cedilla_char('k');
1603  return;
1604  }
1605  if (index + 128 == 0xF9) { /* U+371 LATIN SMALL LETTER U WITH OGONEK */
1606 /* fprintRTF("TRANSLATION");*/
1607  return;
1608  }
1609  if (index + 128 == 0xFD) { /* U+361 LATIN SMALL LETTER U WITH TILDE */
1610  put_tilde_char('u');
1611  return;
1612  }
1613  if (index + 128 == 0xFE) { /* U+363 LATIN SMALL LETTER U WITH MACRON */
1614  put_macron_char('u');
1615  return;
1616  }
1617  if (index + 128 == 0xFF) { /* U+729 DOT ABOVE */
1618  put_dot_char(' ');
1619  return;
1620  }
1621 }
1622 
1623 static void latin5_enc(int index)
1624 {
1625 char *s;
1626  s = latin5_2_ansi[index];
1627  if (s[0]!='0'){
1628  fprintRTF("\\'%s",s);
1629  return;
1630  }
1631  s = latin5_2_sym[index];
1632  if (s[0]!='0'){
1633  int sym=RtfFontNumber("Symbol");
1634  fprintRTF("{\\f%d\\'%s}",sym,s);
1635  return;
1636  }
1637  if (index + 128 == 0xD0) { /* U+286 LATIN CAPITAL LETTER G WITH BREVE */
1638  put_breve_char('G');
1639  return;
1640  }
1641  if (index + 128 == 0xDD) { /* U+304 LATIN CAPITAL LETTER I WITH DOT ABOVE */
1642  put_dot_char('I');
1643  return;
1644  }
1645  if (index + 128 == 0xDE) { /* U+350 LATIN CAPITAL LETTER S WITH CEDILLA */
1646  put_cedilla_char('S');
1647  return;
1648  }
1649  if (index + 128 == 0xEA) { /* U+281 LATIN SMALL LETTER E WITH OGONEK */
1650 /* fprintRTF("TRANSLATION");*/
1651  return;
1652  }
1653  if (index + 128 == 0xEC) { /* U+279 LATIN SMALL LETTER E WITH DOT ABOVE */
1654  put_dot_char('e');
1655  return;
1656  }
1657  if (index + 128 == 0xEF) { /* U+299 LATIN SMALL LETTER I WITH MACRON */
1658  put_macron_char('i');
1659  return;
1660  }
1661  if (index + 128 == 0xF0) { /* U+287 LATIN SMALL LETTER G WITH BREVE */
1662  put_breve_char('g');
1663  return;
1664  }
1665  if (index + 128 == 0xFD) { /* U+305 LATIN SMALL LETTER DOTLESS I */
1666  fprintRTF("i");
1667  return;
1668  }
1669  if (index + 128 == 0xFE) { /* U+351 LATIN SMALL LETTER S WITH CEDILLA */
1670  put_cedilla_char('s');
1671  return;
1672  }
1673 }
1674 
1675 static void latin9_enc(int index)
1676 {
1677 char *s;
1678  s = latin9_2_ansi[index];
1679  if (s[0]!='0'){
1680  fprintRTF("\\'%s",s);
1681  return;
1682  }
1683  s = latin9_2_sym[index];
1684  if (s[0]!='0'){
1685  int sym=RtfFontNumber("Symbol");
1686  fprintRTF("{\\f%d\\'%s}",sym,s);
1687  return;
1688  }
1689  if (index + 128 == 0xA4) { /* U+8364 unknown */
1690 /* fprintRTF("TRANSLATION");*/
1691  return;
1692  }
1693  if (index + 128 == 0xB4) { /* U+381 LATIN CAPITAL LETTER Z WITH CARON */
1694 /* fprintRTF("TRANSLATION");*/
1695  return;
1696  }
1697  if (index + 128 == 0xB8) { /* U+382 LATIN SMALL LETTER Z WITH CARON */
1698 /* fprintRTF("TRANSLATION");*/
1699  return;
1700  }
1701 }
1702 
1703 static void next_enc(int index)
1704 {
1705 char *s;
1706  s = next_2_ansi[index];
1707  if (s[0]!='0'){
1708  fprintRTF("\\'%s",s);
1709  return;
1710  }
1711  s = next_2_sym[index];
1712  if (s[0]!='0'){
1713  int sym=RtfFontNumber("Symbol");
1714  fprintRTF("{\\f%d\\'%s}",sym,s);
1715  return;
1716  }
1717  if (index + 128 == 0xAE) { /* U+64257 LATIN SMALL LIGATURE FI */
1718  fprintRTF("fi");
1719  return;
1720  }
1721  if (index + 128 == 0xAF) { /* U+64258 LATIN SMALL LIGATURE FL */
1722  fprintRTF("fl");
1723  return;
1724  }
1725  if (index + 128 == 0xC1) { /* U+715 MODIFIER LETTER GRAVE ACCENT */
1726 /* fprintRTF("TRANSLATION");*/
1727  return;
1728  }
1729  if (index + 128 == 0xC6) { /* U+728 BREVE */
1730  int num = RtfFontNumber("MT Extra");
1731  fprintRTF("{\\f%d\\'28}", num);
1732  return;
1733  }
1734  if (index + 128 == 0xC7) { /* U+729 DOT ABOVE */
1735  put_dot_char(' ');
1736  return;
1737  }
1738  if (index + 128 == 0xCA) { /* U+730 RING ABOVE */
1739  put_ring_char(' ');
1740  return;
1741  }
1742  if (index + 128 == 0xCD) { /* U+733 DOUBLE ACUTE ACCENT */
1743 /* fprintRTF("TRANSLATION");*/
1744  return;
1745  }
1746  if (index + 128 == 0xCE) { /* U+731 OGONEK */
1747 /* fprintRTF("TRANSLATION");*/
1748  return;
1749  }
1750  if (index + 128 == 0xCF) { /* U+711 CARON */
1751 /* fprintRTF("TRANSLATION");*/
1752  return;
1753  }
1754  if (index + 128 == 0xE8) { /* U+321 LATIN CAPITAL LETTER L WITH STROKE */
1755 /* fprintRTF("TRANSLATION");*/
1756  return;
1757  }
1758  if (index + 128 == 0xF5) { /* U+305 LATIN SMALL LETTER DOTLESS I */
1759  fprintRTF("i");
1760  return;
1761  }
1762  if (index + 128 == 0xF8) { /* U+322 LATIN SMALL LETTER L WITH STROKE */
1763 /* fprintRTF("TRANSLATION");*/
1764  return;
1765  }
1766  if (index + 128 == 0xFE) { /* U+65535 unknown */
1767 /* fprintRTF("TRANSLATION");*/
1768  return;
1769  }
1770  if (index + 128 == 0xFF) { /* U+65535 unknown */
1771 /* fprintRTF("TRANSLATION");*/
1772  return;
1773  }
1774 }
1775 
1776 static void cp1251_enc(int index)
1777 {
1778  char *s;
1779  s = cp1251_2_cp1251[index];
1781 }
1782 
1783 static void cp855_enc(int index)
1784 {
1785  char *s;
1786  s = cp855_2_cp1251[index];
1788 }
1789 
1790 static void cp866_enc(int index)
1791 {
1792  char *s;
1793  s = cp866_2_cp1251[index];
1795 }
1796 
1797 static void koi8r_enc(int index)
1798 {
1799  char *s;
1800  s = koi8r_2_cp1251[index];
1802 }
1803 
1804 static void koi8u_enc(int index)
1805 {
1806  char *s;
1807  s = koi8u_2_cp1251[index];
1809 }
1810 
1811 static void maccyr_enc(int index)
1812 {
1813  char *s;
1814  s = maccyr_2_cp1251[index];
1816 }
1817 
1818 static void macukr_enc(int index)
1819 {
1820  char *s;
1821  s = macukr_2_cp1251[index];
1823 }
1824 
1825 void WriteEightBitChar(char cThis)
1826 {
1827  int index = (int) cThis + 128;
1828  diagnostics(5, "WriteEightBitChar char=%d index=%d encoding=%s",
1829  (int) cThis, index, g_charset_encoding_name);
1830 
1831  if (strcmp(g_charset_encoding_name, "raw") == 0)
1832  fprintRTF("\\'%2X", (unsigned char) cThis);
1833  else if (strcmp(g_charset_encoding_name, "applemac") == 0)
1835  else if (strcmp(g_charset_encoding_name, "cp437") == 0)
1836  cp437_enc(index);
1837  else if (strcmp(g_charset_encoding_name, "cp850") == 0)
1838  cp850_enc(index);
1839  else if (strcmp(g_charset_encoding_name, "cp852") == 0)
1840  cp852_enc(index);
1841  else if (strcmp(g_charset_encoding_name, "cp865") == 0)
1842  cp865_enc(index);
1843  else if (strcmp(g_charset_encoding_name, "437") == 0)
1844  cp437_enc(index);
1845  else if (strcmp(g_charset_encoding_name, "850") == 0)
1846  cp850_enc(index);
1847  else if (strcmp(g_charset_encoding_name, "852") == 0)
1848  cp852_enc(index);
1849  else if (strcmp(g_charset_encoding_name, "865") == 0)
1850  cp865_enc(index);
1851  else if (strcmp(g_charset_encoding_name, "decmulti") == 0)
1853  else if (strcmp(g_charset_encoding_name, "cp1250") == 0)
1854  cp1250_enc(index);
1855  else if (strcmp(g_charset_encoding_name, "cp1252") == 0)
1856  cp1252_enc(index);
1857  else if (strcmp(g_charset_encoding_name, "1250") == 0)
1858  cp1250_enc(index);
1859  else if (strcmp(g_charset_encoding_name, "1252") == 0)
1860  cp1252_enc(index);
1861  else if (strcmp(g_charset_encoding_name, "latin1") == 0)
1862  latin1_enc(index);
1863  else if (strcmp(g_charset_encoding_name, "latin2") == 0)
1864  latin2_enc(index);
1865  else if (strcmp(g_charset_encoding_name, "latin3") == 0)
1866  latin3_enc(index);
1867  else if (strcmp(g_charset_encoding_name, "latin4") == 0)
1868  latin4_enc(index);
1869  else if (strcmp(g_charset_encoding_name, "latin5") == 0)
1870  latin5_enc(index);
1871  else if (strcmp(g_charset_encoding_name, "latin9") == 0)
1872  latin9_enc(index);
1873  else if (strcmp(g_charset_encoding_name, "next") == 0 )
1874  next_enc(index);
1875  else if (strcmp(g_charset_encoding_name, "cp1251") == 0 )
1876  cp1251_enc(index);
1877  else if (strcmp(g_charset_encoding_name, "cp855") == 0 )
1878  cp855_enc(index);
1879  else if (strcmp(g_charset_encoding_name, "cp866") == 0 )
1880  cp866_enc(index);
1881  else if (strcmp(g_charset_encoding_name, "1251") == 0 )
1882  cp1251_enc(index);
1883  else if (strcmp(g_charset_encoding_name, "855") == 0 )
1884  cp855_enc(index);
1885  else if (strcmp(g_charset_encoding_name, "866") == 0 )
1886  cp866_enc(index);
1887  else if (strcmp(g_charset_encoding_name, "koi8-r") == 0 )
1888  koi8r_enc(index);
1889  else if (strcmp(g_charset_encoding_name, "koi8-u") == 0 )
1890  koi8u_enc(index);
1891  else if (strcmp(g_charset_encoding_name, "maccyr") == 0 )
1892  maccyr_enc(index);
1893  else if (strcmp(g_charset_encoding_name, "macukr") == 0 )
1894  macukr_enc(index);
1895 }
1896 
1897 
void CmdCyrillicStrChar(char *s)
int strcmp()
Definition: coll.cpp:143
char latin4_2_ansi[128][3]
char latin3_2_ansi[128][3]
char cp1252_2_ansi[128][3]
char cp1250_2_ansi[128][3]
char cp1250_2_sym[128][3]
char latin2_2_ansi[128][3]
char applemac_2_sym[128][3]
Definition: encode_tables.h:19
char latin5_2_sym[128][3]
char cp1252_2_sym[128][3]
char macukr_2_cp1251[128][3]
char latin1_2_ansi[128][3]
char maccyr_2_cp1251[128][3]
char cp437_2_ansi[128][3]
Definition: encode_tables.h:37
char koi8r_2_cp1251[128][3]
char latin9_2_ansi[128][3]
char next_2_ansi[128][3]
char latin5_2_ansi[128][3]
char cp850_2_ansi[128][3]
Definition: encode_tables.h:73
char decmulti_2_ansi[128][3]
char latin1_2_sym[128][3]
char cp852_2_ansi[128][3]
char cp866_2_cp1251[128][3]
char latin3_2_sym[128][3]
char next_2_sym[128][3]
char latin4_2_sym[128][3]
char koi8u_2_cp1251[128][3]
char cp855_2_cp1251[128][3]
char cp852_2_sym[128][3]
char cp865_2_sym[128][3]
char latin2_2_sym[128][3]
char latin9_2_sym[128][3]
char applemac_2_ansi[128][3]
Definition: encode_tables.h:1
char cp437_2_sym[128][3]
Definition: encode_tables.h:55
char cp850_2_sym[128][3]
Definition: encode_tables.h:91
char cp865_2_ansi[128][3]
char cp1251_2_cp1251[128][3]
char decmulti_2_sym[128][3]
#define s
Definition: afcover.h:80
#define c(n)
Definition: gpos-common.c:150
int num
Definition: disdvi.c:621
static void latin1_enc(int index)
Definition: encode.c:1005
static void latin2_enc(int index)
Definition: encode.c:1021
static void maccyr_enc(int index)
Definition: encode.c:1811
void WriteEightBitChar(char cThis)
Definition: encode.c:1825
static void latin3_enc(int index)
Definition: encode.c:1258
static void put_cedilla_char(char c)
Definition: encode.c:52
static void put_breve_char(char c)
Definition: encode.c:36
static void put_tilde_char(char c)
Definition: encode.c:74
static void latin5_enc(int index)
Definition: encode.c:1623
static void applemac_enc(int index)
Definition: encode.c:90
static void cp866_enc(int index)
Definition: encode.c:1790
static void cp865_enc(int index)
Definition: encode.c:544
static void next_enc(int index)
Definition: encode.c:1703
static void koi8u_enc(int index)
Definition: encode.c:1804
static void macukr_enc(int index)
Definition: encode.c:1818
static void cp437_enc(int index)
Definition: encode.c:147
static void koi8r_enc(int index)
Definition: encode.c:1797
static void cp850_enc(int index)
Definition: encode.c:219
static void cp855_enc(int index)
Definition: encode.c:1783
static void put_dot_char(char c)
Definition: encode.c:82
static void cp1252_enc(int index)
Definition: encode.c:881
static void latin4_enc(int index)
Definition: encode.c:1415
static void put_ring_char(char c)
Definition: encode.c:60
static void cp1251_enc(int index)
Definition: encode.c:1776
static void cp1250_enc(int index)
Definition: encode.c:616
static void put_acute_char(char c)
Definition: encode.c:45
static void cp852_enc(int index)
Definition: encode.c:275
static void put_macron_char(char c)
Definition: encode.c:67
static void latin9_enc(int index)
Definition: encode.c:1675
static void decmulti_enc(int index)
Definition: encode.c:929
void diagnostics(int level, char *format,...)
Definition: main.c:469
void fprintRTF(char *format,...)
Definition: main.c:722
char g_charset_encoding_name[20]
Definition: main.c:70
char g_field_separator
Definition: main.c:105
int RtfFontNumber(char *Fname)
Definition: l2r_fonts.c:103
int CurrentFontSize(void)
Definition: l2r_fonts.c:665
#define index(s, c)
Definition: plain2.h:351
Definition: mendex.h:20
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)
#define sym(x)
Definition: y.tab.c:133