[tex-live] cp227.tcx default mapping

David Kastrup dak at gnu.org
Sat Jul 31 02:12:19 CEST 2004

karl at freefriends.org (Karl Berry) writes:

> After discussions with Olaf, Hans, and Thomas (Sebastian was included,
> but appears to be busy with other things), we reached a consensus of
> using a new file cp227.tcx as the -translate-file for all formats except
> ConTeXt (which remains using -8bit).
>
> This new tcx makes codes 128 and above printable, as just (the misnamed)
> cp8bit.tcx does that we used last year.  In addition, it makes tab
> (0x9), vertical tab (0xa), and form feed (0xb) printable.  All other
> codes <=31 remain unprintable and will appear in ^^ notation.
>
> As originally noted by Paul Vojta, this has the downside that certain
> diagnostics to tty will be difficult to understand, for example:
>   \showhyphens{$\Psi} > writes this to the terminal: > Underfull \hbox (badness 10000) detected at line 0 > []$\tenrm 	\$
> (that's a real tab character after the \tenrm)
> This is because \Psi is \mathchardef to "..09.  Similarly for \Omega and
> \alpha.
>
> But the advantage is that now real tabs and form feeds in the input will
> *not* be translated to ^^I and ^^L when TeX writes error messages.

What would actually be needed is a special mode for error contexts in
which TeX does not translate at all.

I am trying to get this wrapped by preview-latex (and later AUCTeX)
currently regardless of the encoding.  Particularly ugly is the
following:

ERROR: Undefined control sequence.

--- TeX said ---
l.5 ...f^^87^^e1^^bf^^87 ^^e1^^bc^^a6^^ce^^bd\barf
^^e1^^bd^^81 ^^ce^^bb^^e1...

The "...f" actually is the tail from something like ^^8f -- argh!  TeX
cuts the error context off in the middle of a byte!

It would at least appear that TeX will cut the _trailing_ error
context off at byte boundaries, no idea why that would be the case if
it does not care at the front.  But it still is not a UTF-8 character
boundary where the cut occurs.

Also note that the above output gets produced by default from
TeXlive2003 with a valid utf8 locale.

Sigh.  Programming TeX shells is no fun.

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum