Skip to content

Commit

Permalink
Add a shorter work around for the UTF-8 output problem to the docs.
Browse files Browse the repository at this point in the history
Downside is that 'use open' can be a bit flakey in older Perls.
Not sure how to document that.
  • Loading branch information
schwern committed Apr 15, 2013
1 parent 48c1258 commit 55a8c51
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.98_05
Doc Changes
* Add a shorter work around for the UTF-8 output problem.
(Michael G Schwern)


0.98_04 Sun Apr 14 10:54:13 BST 2013
Distribution Changes
* Scalar::Util 1.13 (ships with Perl 5.8.1) is now required.
Expand Down
16 changes: 11 additions & 5 deletions lib/Test/More.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1790,13 +1790,19 @@ Test::More) duplicates STDOUT and STDERR. So any changes to them,
including changing their output disciplines, will not be seem by
Test::More.
The work around is to change the filehandles used by Test::Builder
directly.
One work around is to apply encodings to STDOUT and STDERR as early
as possible and before Test::More (or any other Test module) loads.
use open ':std', ':encoding(utf8)';
use Test::More;
A more direct work around is to change the filehandles used by
Test::Builder.
my $builder = Test::More->builder;
binmode $builder->output, ":utf8";
binmode $builder->failure_output, ":utf8";
binmode $builder->todo_output, ":utf8";
binmode $builder->output, ":encoding(utf8)";
binmode $builder->failure_output, ":encoding(utf8)";
binmode $builder->todo_output, ":encoding(utf8)";
=item Overloaded objects
Expand Down

0 comments on commit 55a8c51

Please sign in to comment.