Subject: | Layers not functioning properly after capture |
In Perl 5.16, after a capture, although PerlIO reports the correct
layers on STDOUT, they aren't working correctly.
Subject: | test.pl |
#!/usr/local/bin/perl
use v5.16;
use Encode;
use open qw(:encoding(utf8) :std);
use Capture::Tiny qw(capture);
my $foo = Encode::decode_utf8("\xC5\x82");
out('PRE');
capture {};
out('POST');
#===================================
sub out {
#===================================
say "$_[0]:";
say join ', ', PerlIO::get_layers( \*STDOUT );
say $foo;
say '';
}
# PRE:
# unix, perlio, encoding(utf8), utf8
# Å
#
# POST:
# unix, perlio, encoding(utf8), utf8
# Wide character in say at bin/test.pl line 19.
# Å
#