[tex-k] "char" type in tex.web

Wolfgang Helbig helbig at mailbox.org
Fri Nov 20 13:03:06 CET 2020

Dear Igor,

> tex.web was made for Pascal where "char" type is 8-bit.
No! The number of bits of chars is not defined in Pascal, but system 
dependent. And consequently it is defined in the system dependent module 
19. By the way, the first edition "TeX The program" defines 
last_text_char = 127.

To me, it is not quite clear what is so great about eight bit external 
characters. OK, eight is more than seven, and bigger is better than 
smaller in some parts of the world, but that seems to be the only 
advantage. To exploit the extra freedom, the characters in all your text 
input files, including the WEB and PASCAL source, must be encoded the 
same way! And binary distributions would impose one and the same  
encoding for the characters between 128 and 255.  This rules out UTF-8, 
which is ASCII for characters 0..127 and 16 bit codes above 127.

So much for the encoding of external characters. But another change is 
much more useful, namely the extension of the internal character set of 
TeX. Now 256 characters instead of 128 might be defined by METAFONT.

> It follows from the fact that "char" is the same as "text_char" (§19)
> and "text_char" is 0..255 (§19).
> And §521 is in "system dependencies", so everything is consistent.
> Regards,
> Igor
> On 18/11/2020, Igor Liferenko <igor.liferenko at gmail.com> wrote:
>> Hi all,
>> In §19 there is this text:
>> ... other Pascals consider `char' to be a 64-element ...
>> I cannot reconcile this with §521, where
>> "TEX_format_default" (which is of type "char") is assigned the
>> value  "TeXformats:plain.fmt ", which consists of characters which are in
>> the
>> range 0..127 (notice the lowercase letters).
>> This code should then fail on such Pascals.
>> On this list there should be people who can explain this...
>> Greetings
>> Igor


Wolfgang Helbig

More information about the tex-k mailing list.