develooper Front page | perl.perl5.porters | Postings from May 2012

5.16.0-RC1: mro/package_aliases_utf8.t failing with PERL_UNICODE=A

From:
Lukas Mai
Date:
May 15, 2012 00:07
Subject:
5.16.0-RC1: mro/package_aliases_utf8.t failing with PERL_UNICODE=A
Message ID:
20120515090712.5946bf9b@web.de
Hi,

t/mro/package_aliases_utf8.t is failing for me:

# Failed test 11 - replacing nonexistent nested packages by assigning a glob to a glob updates isa caches (인ንʵ) at ./test.pl line 864
#      got "Cannot decode string with wide characters at ../lib/Encode.pm line 176."
# expected "ok 1\nok 2\nok 3\nok 4"

This happens because the test runs `perl foo.pl $unicode_string` and foo.pl
blindly tries to decode @ARGV as UTF-8. This fails because I've got
PERL_UNICODE=A in my environment (more specifically, PERL_UNICODE=SAL and
LANG=en_US.UTF-8), so @ARGV gets automatically decoded by perl. By the time
foo.pl calls Encode::decode("UTF-8", $ARGV[0]), it's already unicode text.

The solution is probably to set $ENV{PERL_UNICODE} = 0 before shelling out.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About