Skip Menu |
 

This queue is for tickets about the Test-Harness CPAN distribution.

Report information
The Basics
Id: 72613
Status: new
Priority: 0/
Queue: Test-Harness

People
Owner: Nobody in particular
Requestors: ovid [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.23
Fixed in: (no value)



Subject: UTF-8 to STDOUT broken?
Download (untitled) / with headers
text/plain 1.3k
I think the following should show the problem. When PERL_UNICODE is set to AS (see -C in perlrun), then STDIN, STDOUT and STDERR are all opened as utf8. Combine that with "use utf8" in your code and, if everything is UTF-8, then Perl magically *works* with UTF-8 (cough). Consider this file: $ cat munchen.t #!/usr/bin/env perl use strict; use warnings; use utf8; print "1..1\n"; print "ok 1 - München\n"; We manually print test results to make it clear that no Test:: module's output is broken. Here's the default behavior: $ perl munchen.t 1..1 ok 1 - M?nchen Hmm, that's not good, so let's set the PERL_UNICODE variable. $ PERL_UNICODE=AS perl munchen.t 1..1 ok 1 - München OK, that's perfect. Now with "prove". $ prove -v munchen.t munchen.t .. 1..1 ok 1 - M?nchen ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.03 usr + 0.01 sys = 0.04 CPU) Result: PASS That's not surprising, so let's set the PERL_UNICODE again. $ PERL_UNICODE=AS prove -v munchen.t munchen.t .. 1..1 ok 1 - München ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.06 usr + 0.01 sys = 0.07 CPU) Result: PASS Oh, that's disappointing. I wish I had time to dig into this, but I don't. Sorry :/ Cheers, Ovid


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.