Package: libwww-mechanize-perl
Version: 1.73-1
Tags: upstream
Forwarded: 
https://code.google.com/p/www-mechanize/issues/detail?id=261&q=encoding
User: debian-p...@lists.debian.org
Usertags: perl-5.20-transition

The test suite of libwww-mechanize-perl generates messages like

 t/local/follow.t .. Use of the encoding pragma is deprecated at 
t/local/follow.t line 8.
 t/local/follow.t .. 1/28 Use of the encoding pragma is deprecated at 
/home/niko/tmp/libwww-mechanize-perl/t/local/log-server line 6.

Quoting the documentation for the encoding pragma:

    This module is deprecated under perl 5.18. It uses a mechanism
    provided by perl that is deprecated under 5.18 and higher, and may
    be removed in a future version.

The usage, at least in t/local/log-server, which is the more common
of the two, is something of a mess. It has

 use encoding 'iso-8859-1';
 [...]
 binmode DATA,':encoding(iso-8859-1)';
 my $body = join "", <DATA>;

with latin1 characters in the __DATA__ section.

I'm not sure if this actually works; possibly two "errors" cancel each
other out. AFAICS "use encoding" transforms the latin1 characters into
utf8, then reading <DATA> with latin1 encoding gets the two bytes of
the utf8 representation into separate characters. This seems broken to me.

My attempts at fixing this lead to t/local/get.t disagreeing about the
number of bytes returned, and changing that part risks subverting the
meaning of the tests, so I'm leaving it as-is for now.

We can revisit it if 'use encoding' is actually dropped in a future
Perl release.
-- 
Niko Tyni   nt...@debian.org


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to