[tex-live] bug in TeX Live Utility

Manuel Pégourié-Gonnard mpg at elzevir.fr
Mon Jul 13 21:29:27 CEST 2009


Manuel Pégourié-Gonnard a écrit :
>>> Evidently that binmode is causing double encoding.  I don't remember why
>>> it's there.
>>>
> I tend to think that the binmode here is not the cause. The cause it that Perl
> somehow gets utf8 strings without properly marking them as utf8. If all utf8
> strings are known to be utf8 by Perl, nothing will get
> double-latin1-to-utf8-encoded.
> 
I just tested. Changing line 268 of tlpkg/TeXLive/TLPDB.pm to

    open(TMP, '<:encoding(utf8)', $path) || die "$0: open($path) failed: $!";

also solves the problem. So I persist in thinking that removing

binmode(STDOUT, ":utf8");

is not the right solution. If we want tlmgr to output real utf8, we *need* this
binmode statement.

> use open IO => ':utf8';   # default encoding for files we open later

For some reason, just putting

use open IO => ':utf8';

right after the BEGIN block in tlmgr.pl doesn't solve the problem. I thought it
would introduce and implicit :utf8 (equivalent to :encoding(utf8)) in all open()
statements afterwards, apparently not.

So this needs further investigation. I'm going to re-read some Perl doc for
starters.

Manuel.



More information about the tex-live mailing list