14 messages in org.perl.perl-qaTest::Builder versus Unicode
FromSent OnAttachments
OvidDec 20, 2004 4:50 pm 
Michael G SchwernDec 20, 2004 6:06 pm 
David WheelerDec 20, 2004 6:13 pm 
Michael G SchwernDec 20, 2004 6:18 pm 
David WheelerDec 20, 2004 6:20 pm 
chromaticDec 20, 2004 6:27 pm 
Michael G SchwernDec 20, 2004 6:30 pm 
David WheelerDec 20, 2004 6:37 pm 
Michael G SchwernDec 20, 2004 6:41 pm 
David WheelerDec 20, 2004 6:43 pm 
David WheelerDec 22, 2004 10:25 am 
Nicholas ClarkDec 22, 2004 10:45 am 
OvidDec 22, 2004 11:41 am 
Nicholas ClarkDec 22, 2004 11:48 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Test::Builder versus UnicodeActions...
From:Ovid (publ@yahoo.com)
Date:Dec 20, 2004 4:50:35 pm
List:org.perl.perl-qa

Hi all,

The following code:

use utf8; use diagnostics; BEGIN {binmode STDOUT, ':utf8';} use Test::More tests => 1; # those are smart quotes diag "This is a \x{201c}test\x{201d}"; ok 1;

Produces the following error message:

1..1 Wide character in print at /usr/local/lib/perl5/5.8.5/Test/Builder.pm line 1005 (#1) (W utf8) Perl met a wide character (>255) when it wasn't expecting one. This warning is by default on for I/O (like print). The easiest way to quiet this warning is simply to add the :utf8 layer to the output, e.g. binmode STDOUT, ':utf8'. Another way to turn off the warning is to add no warnings 'utf8'; but that is often closer to cheating. In general, you are supposed to explicitly mark the filehandle with an encoding, see open and perlfunc/binmode.

# This is a “test” ok 1

And looking at line 1005:

sub _print_diag { my $self = shift;

local($\, $", $,) = (undef, ' ', ''); my $fh = $self->todo ? $self->todo_output : $self->failure_output; print $fh @_; # here there be smart quotes }

There are a few strange paths in the code which could be causing this (I'm wondering about the autoflush), but I was wondering if anyone has seen this and knows how to cope with it? As you can see, I've tried that standard binmode ':utf8' and using utf8, but to no avail.