Subject: | t/utf8_binary.t fails with PERL_UNICODE=S |
My PERL_UNICODE environment variable is set to "SAL" (and LANG=en_US.UTF-8). This (specifically the S) makes your module fail its tests. (Usually this indicates a missing 'binmode STDIN' or 'binmode STDOUT' somewhere.)
$ PERL_UNICODE=S perl -Mblib t/utf8_binary.t
1..5
# Running under perl version 5.022001 for linux
# Current time local: Thu May 5 11:00:31 2016
# Current time GMT: Thu May 5 09:00:31 2016
# Using Test.pm version 1.26
# I'm testing Term::ReadLine::Gnu version 1.31
ok 1
æ¼¢å1
$VAR1 = 'æ¼¢å1';
$VAR2 = 'æ¼¢å1';
ok 2
#i: unix:perlio
#o: unix:perlio:utf8
ok 3
#i: unix:perlio:stdio
#o: unix:perlio:utf8
Show quoted text
漢字> 漢字2
漢字2
$VAR1 = "\x{6f22}\x{5b57}2";
$VAR2 = 'æ¼¢å2';
not ok 4
# Failed test 4 in t/utf8_binary.t at line 74
# t/utf8_binary.t line 74 is: ok($line eq "æ¼¢å2");
not ok 5
# Failed test 5 in t/utf8_binary.t at line 75
# t/utf8_binary.t line 75 is: ok(!utf8::is_utf8($line));
For comparison, without S:
$ PERL_UNICODE=0 perl -Mblib t/utf8_binary.t
1..5
# Running under perl version 5.022001 for linux
# Current time local: Thu May 5 11:01:02 2016
# Current time GMT: Thu May 5 09:01:02 2016
# Using Test.pm version 1.26
# I'm testing Term::ReadLine::Gnu version 1.31
ok 1
漢字1
$VAR1 = '漢字1';
$VAR2 = '漢字1';
ok 2
#i: unix:perlio
#o: unix:perlio
ok 3
#i: unix:perlio:stdio
#o: unix:perlio:stdio
Show quoted text漢字> 漢字2
漢字2
$VAR1 = '漢字2';
$VAR2 = '漢字2';
ok 4
ok 5