<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#! /usr/bin/perl -T -w

=head1 NAME

latexout.pl - Filters the LaTeX log and output, so that UTF8 stays UTF8.

=head1 SYNOPSIS

latex I&lt;arguments&gt; | latexout.pl

=head1 DESCRIPTION

TeX replaces bytes in the range of 0x80 to 0x9F by ^^xx
sequences. This filter restores them.

=head1 BUGS

Only complete lines are parsed, so when TeX wants input, the prompt is
not displayed.

=head1 AUTHOR

Dominique Unruh &lt;I&lt;unruh@ut.ee&gt;&gt;.

=head1 SEE ALSO

The LaTeX package B&lt;ucs.sty&gt;.

=cut

$| = 1;

while (&lt;&gt;) {
    s/\^\^([0-9a-f]{2})/chr hex $1/egi;
    print $_;
}
</pre></body></html>