I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2008-07-22 12:54:23-07 by mjevans
How can I enable utf8 layer on diag output
use strict; use warnings; use Test::More qw(no_plan); binmode STDOUT, ":utf8"; binmode STDERR, ":utf8"; my $data = "\x{263a}xxx" . chr(0x05d0) . "\x{20ac}"; diag($data);

produces:

Wide character in print at /usr/share/perl/5.8/Test/Builder.pm line 1275. # unicode charatcers here I had to remove to get cpanforum to accept # No tests run!

How can I enable utf8 layer on diag output when using Test::More?

Martin
Direct Responses: 8383 | Write a response
Posted on 2008-07-23 07:23:31-07 by mjevans in response to 8370
Re: How can I enable utf8 layer on diag output
ok, I've found out how to do this and why the above does not work. Test::Builder duplicates your STDOUT and STDERR but does not duplicate the layers in use on them - there appears to be code to do this but it is commented out. The way you can do it is:
my $tb = Test::More->builder; binmode($tb->failure_output, ':utf8'); binmode($tb->output, ':utf8');
Direct Responses: Write a response