[comp.text.tex] Code pages

dhosek@euler.claremont.edu (Don Hosek) (02/26/91)

In article <MATTES.91Feb25122908@azu.informatik.uni-stuttgart.de>, mattes@azu.informatik.uni-stuttgart.de (Eberhard Mattes) writes:
> Don Hosek wrote:
> dh>> The latter area is where code pages come into play. But let's not ignore
> dh>> the other crucial tasks mentioned above.
> dh>
> dh>Actually, no. The code page support that I've seen simply causes
> dh>TeX's mouth to interpret, say x'84 as \"{u}. It does nothing for
> dh>the accented character "problem".
 
> The code page support of emTeX has two aspects:
> - Convert character codes 128..255 int TeX sequences; see above.
>   This feature is redundant in TeX 3.0.
> - Loading the internal TeX arrays xord and xchr. This feature
>   is required if one wants input and output translation
>   (as required due to different code pages on the IBM PC)
>   and if characters 128..255 should be treated equally to
>   the ASCII characters 0..127 (w.r.t. \catcode). If you
>   do the translation using TeX commands, you have to
>   \catcode those characters \active.

Yes, but the trade-off is not that bad. So you can't use those
characters in control sequence names (which is actually a
half-truth, but the vagaries are such that I'd rather let it
stand), but other than that, I have yet to see any problems with
it. Perhaps if one is redefining the characters in a stupid way..

One example I remember vaguely was trying to get, say x'a0 and
x'b0 to swap their meanings.

Now if one defines, e.g., 
\catcode`^^b0=\active \def^^b0{^^a0}
\catcode`^^a0=\active \def^^a0{^^b0}
then you only get what you asked for.

By appropriate setting of category codes and some decent
macro-writing, better results can be achieved.

There is a lot of value in being able to modify the xchar/xord
arrays dynamically, but not in the manner that is currently
provided in those TeX implementations which provide it. What is
needed is the ability to switch code pages arbitrarily in a
document. What? You never wanted to include Russian text in an
English document? Greek in Arabic? Hebrew in French?
Unfortunately, this capability, beyond what I've outlined above,
cannot be accomplished any program that wants to call itself TeX.

-dh

---
Don Hosek   To retrieve files from ymir via the    | dhosek@ymir.claremont.edu
            mailserver, send a message to          | Quixote TeX Consulting
            mailserv@ymir.claremont.edu with a     | 714-625-0147
            line saying send [DIRECTORY]FILENAME 
            where DIRECTORY is the FTP directory (sans "anonymous") and 
            FILENAME is the filename, e.g. "send [tex]00readme.txt". There is
            a list of files in each directory under the name 00files.txt
            Binary files are not available by this technique.