| 1 |
% mixcodes.tex ... allows mix od UTF-8, ISO-8859-2 and CP1250 in input files |
| 2 |
% -------------------------------------------------------------------------- |
| 3 |
% Petr Olsak, Oct. 2012 |
| 4 |
% |
| 5 |
% You need to use the csplain initialised by encTeX with UTF-8 input |
| 6 |
% |
| 7 |
% After \input mixcodes |
| 8 |
% |
| 9 |
% you can input the files with czech+slovak alphabet encoded |
| 10 |
% by UTF-8 or ISO-8859-2 or CP1250 ecodings. You can input more files with |
| 11 |
% various of these three encodings. The output by \write is always done by |
| 12 |
% UTF-8 encoding and you can read these files again. |
| 13 |
|
| 14 |
% This is a little ,,dirty trick`` using encTeX :-) |
| 15 |
|
| 16 |
% Note: there is a conflict between the slovak lcaron and the czech zcaron |
| 17 |
% characters. See the end of this file of more information about it. |
| 18 |
|
| 19 |
\ifx\mubyte\undefined |
| 20 |
\message{WARNING: I need encTeX initialised, all settings are ignored} |
| 21 |
\expandafter\endinput \fi |
| 22 |
|
| 23 |
% ISO-8859-2 on input needs one-to-one reencoding. |
| 24 |
% We need to re-declarare the original table defined in utf8unkn.tex. |
| 25 |
|
| 26 |
\mubyte ^^c1 ^^c1\endmubyte % \'A |
| 27 |
\mubyte ^^e1 ^^e1\endmubyte % \'a |
| 28 |
\mubyte ^^c9 ^^c9\endmubyte % \'E |
| 29 |
\mubyte ^^e9 ^^e9\endmubyte % \'e |
| 30 |
\mubyte ^^cd ^^cd\endmubyte % \'I |
| 31 |
\mubyte ^^ed ^^ed\endmubyte % \'i |
| 32 |
\mubyte ^^d3 ^^d3\endmubyte % \'O |
| 33 |
\mubyte ^^f3 ^^f3\endmubyte % \'o |
| 34 |
\mubyte ^^da ^^da\endmubyte % \'U |
| 35 |
\mubyte ^^fa ^^fa\endmubyte % \'u |
| 36 |
\mubyte ^^dd ^^dd\endmubyte % \'Y |
| 37 |
\mubyte ^^fd ^^fd\endmubyte % \'y |
| 38 |
\mubyte ^^d4 ^^d4\endmubyte % \^O |
| 39 |
\mubyte ^^f4 ^^f4\endmubyte % \^o |
| 40 |
\mubyte ^^c4 ^^c4\endmubyte % \"A |
| 41 |
\mubyte ^^e4 ^^e4\endmubyte % \"a |
| 42 |
\mubyte ^^d6 ^^d6\endmubyte % \"O |
| 43 |
\mubyte ^^f6 ^^f6\endmubyte % \"o |
| 44 |
\mubyte ^^dc ^^dc\endmubyte % \"U |
| 45 |
\mubyte ^^fc ^^fc\endmubyte % \"u |
| 46 |
\mubyte ^^c8 ^^c8\endmubyte % \v C |
| 47 |
\mubyte ^^e8 ^^e8\endmubyte % \v c |
| 48 |
\mubyte ^^cf ^^cf\endmubyte % \v D |
| 49 |
\mubyte ^^ef ^^ef\endmubyte % \v d |
| 50 |
\mubyte ^^cc ^^cc\endmubyte % \v E |
| 51 |
\mubyte ^^ec ^^ec\endmubyte % \v e |
| 52 |
\mubyte ^^c5 ^^c5\endmubyte % \' L |
| 53 |
\mubyte ^^e5 ^^e5\endmubyte % \' l |
| 54 |
\mubyte ^^a5 ^^a5\endmubyte % \v L |
| 55 |
\mubyte ^^b5 ^^b5\endmubyte % \v l |
| 56 |
\mubyte ^^d2 ^^d2\endmubyte % \v N |
| 57 |
\mubyte ^^f2 ^^f2\endmubyte % \v n |
| 58 |
\mubyte ^^d8 ^^d8\endmubyte % \v R |
| 59 |
\mubyte ^^f8 ^^f8\endmubyte % \v r |
| 60 |
\mubyte ^^a9 ^^a9\endmubyte % \v S |
| 61 |
\mubyte ^^b9 ^^b9\endmubyte % \v s |
| 62 |
\mubyte ^^ab ^^ab\endmubyte % \v T |
| 63 |
\mubyte ^^bb ^^bb\endmubyte % \v t |
| 64 |
\mubyte ^^d9 ^^d9\endmubyte % \r U |
| 65 |
\mubyte ^^f9 ^^f9\endmubyte % \r u |
| 66 |
\mubyte ^^ae ^^ae\endmubyte % \v Z |
| 67 |
\mubyte ^^be ^^be\endmubyte % \v z |
| 68 |
\mubyte ^^c0 ^^c0\endmubyte % \' R |
| 69 |
\mubyte ^^e0 ^^e0\endmubyte % \' r |
| 70 |
\mubyte ^^a7 ^^c2^^a7\endmubyte % section sign ISO input, UTF-8 output |
| 71 |
|
| 72 |
% CP1250 to ISO8859-2 re-encoding: |
| 73 |
|
| 74 |
\mubyte ^^a5 ^^bc\endmubyte % \v L, don't use zacute in ISO-8859-2 input |
| 75 |
\mubyte ^^a9 ^^8a\endmubyte % \v S, safe reencoding |
| 76 |
\mubyte ^^ab ^^8d\endmubyte % \v T, safe reencoding |
| 77 |
\mubyte ^^ae ^^8e\endmubyte % \v Z, safe reencoding |
| 78 |
\mubyte ^^b9 ^^9a\endmubyte % \v s, safe reencoding |
| 79 |
\mubyte ^^bb ^^9d\endmubyte % \v t, safe reencoding |
| 80 |
\mubyte ^^be ^^9e\endmubyte % \v z, safe reencoding |
| 81 |
\if\language=\slovak |
| 82 |
\mubyte ^^e5 ^^be\endmubyte % see comments at the end of the file |
| 83 |
\fi |
| 84 |
|
| 85 |
% After setting \mubyte <code> <the-same-code>\endmubyte, the mubyte table |
| 86 |
% is removed. In order to work the UTF-8 input properly, we need to read |
| 87 |
% csenc-u.tex file again: |
| 88 |
|
| 89 |
\input csenc-u |
| 90 |
|
| 91 |
\endinput |
| 92 |
|
| 93 |
The character code ^^be is: zcaron in ISO-8859-2 (used by Czech) but |
| 94 |
the same code is lcaron in CP1250 (used by Slovak language). |
| 95 |
|
| 96 |
Slovak users have to write \shyph before \input mixcodes in order to the |
| 97 |
lcaron works in both encodings (CP1250 and ISO-8859-2). The zcaron is not |
| 98 |
working in ISO-8859-2 in such case. Czech users don't write \shyph before |
| 99 |
\input mixcodes, thus the zcaron works in both encodings but lcaron doesn't |
| 100 |
work in CP1250. |
| 101 |
|
| 102 |
The UTF-8 encoding is without problems in both languages, of course. |
| 103 |
|