Grokbase Groups Perl qa February 2014
FAQ

On Sat, Feb 15, 2014 at 04:22:59PM +0100, Olivier Mengué wrote:
Hi,

I would like to use non-ASCII, non-Latin-1 characters in test script output.

So far I've written the following:

use Test::More;
use Term::Encoding 'term_encoding';
my $enc = term_encoding();
note $enc; # Ensure that builder->output is opened
binmode($_, ":encoding($enc)")

for Test::More->builder->output;
I just do this in tests which deal with utf8 content:

use utf8;
binmode $_, ':utf8' foreach map { Test::Builder->new->$_ } qw(output failure_output);

It would certainly be nice if there were a more direct interface to set the
binmode of all handles at once.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 3 | next ›
Discussion Overview
groupqa @
categoriesperl
postedFeb 15, '14 at 3:23p
activeFeb 15, '14 at 5:25p
posts3
users3
websiteqa.perl.org

People

Translate

site design / logo © 2021 Grokbase