[LA.pm] Wide character warnings from Test::Builder

Kevin Scaldeferri kevin at scaldeferri.com
Mon May 24 18:19:17 CDT 2004


Back on topic...

I've got some unit tests which have the annoying property of complaining 
about wide characters. Here's a simple test which reproduces the problem


=======================
#!/usr/local/bin/perl

use strict;
use warnings;

use Test::More tests => 1;

my $korean = "\x{B514}\x{C790}\x{C778} \x{BA85}\x{D568}";

ok(1, $korean);
=====================

This produces the output:

[kevin]% perl foo.t
1..1
Wide character in print at /usr/lib/perl5/5.8.0/Test/Builder.pm line 894.
ok 1 - 디자

even though I have my locale set to UTF-8. If I just print the term, 
there is no complaint. I spent a while looking at the Test::More and 
Test::Builder code and tried pulling bits out (duping STDOUT, pushing it 
through the filtering regex) and I couldn't make the warning happen.

Has anyone else experienced this problem and know how to avoid it?


-kevin



More information about the Losangeles-pm mailing list