[tex-live] locale dependent writing to log/terminal is *broken*

Thomas Esser te at dbs.uni-hannover.de
Sat Sep 20 13:42:41 CEST 2003


Hi,

as Staszek has pointed out several times, there is still a problem. All
writes to terminal and log are not done according to the is_printable
array (which is filled correctly when using tcx), but only according to
the locale dependend isprint() function.

This in itself was Olaf's intention, but the bug comes now. When using
non-trivial mappings with tcx files, isprint() is given the wrong
character to check.

For me, it is easier to read the output of web2c, which is:

  if ( ( ( selector <= 16 ) && ( ! isprintable [k ]) ) || ( ( selector > 16
  ) && ( ! isprint ( k ) ) ) )

That means, that if selector > 16 (output to terminal or log) then it
is checked if "k" is considered printable by the locale. Depending on
this check, either
  printvisiblechar ( s )
is called (then, we get the 8bit output that we want) or we'll see some
^^ representation. But, if we look what printvisiblechar, we see that
it does not print its argument directly, but first applies Xchr to it.

That means, that not the caracter to be printed is checked, but something
else. That's wrong and that explains Staszek's gerbage.

As an example, the Aogonek (0xa1) is printable in the polish locale
on Linux. It's tcx-translation (char 0x81) is not printable in that
locale. So, tex outputs ^^81 instead of the Aogonek to terminal and log.

For a test, just try

%& -translate-file=il2-pl.tcx
\foo ¡ % 
\bye

Thomas


More information about the tex-live mailing list