

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
14 messages in org.perl.perl-qaTest::Builder versus Unicode| From | Sent On | Attachments |
|---|---|---|
| Ovid | Dec 20, 2004 4:50 pm | |
| Michael G Schwern | Dec 20, 2004 6:06 pm | |
| David Wheeler | Dec 20, 2004 6:13 pm | |
| Michael G Schwern | Dec 20, 2004 6:18 pm | |
| David Wheeler | Dec 20, 2004 6:20 pm | |
| chromatic | Dec 20, 2004 6:27 pm | |
| Michael G Schwern | Dec 20, 2004 6:30 pm | |
| David Wheeler | Dec 20, 2004 6:37 pm | |
| Michael G Schwern | Dec 20, 2004 6:41 pm | |
| David Wheeler | Dec 20, 2004 6:43 pm | |
| David Wheeler | Dec 22, 2004 10:25 am | |
| Nicholas Clark | Dec 22, 2004 10:45 am | |
| Ovid | Dec 22, 2004 11:41 am | |
| Nicholas Clark | Dec 22, 2004 11:48 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Test::Builder versus Unicode | Actions... |
|---|---|---|
| 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.
Cheers, Ovid
=====
Silence is Evil
http://users.easystreet.com/ovid/philosophy/decency.html
Ovid http://www.perlmonks.org/index.pl?node_id=17000
Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/







