On Sun, Feb 12, 2012 at 5:02 PM, Father Chrysostomos via RT < perlbug-followup@perl.org> wrote: > That it is currently buggy is not being questioned. And the following test will detect regressions once its fixed. ===== use strict; use warnings; use Test::More tests => 1; sub read_from_scalar { my ($file, $perlio) = @_; $perlio //= ''; open my $fh, "<$perlio", \$file or die $!; local $/; return <$fh>; } sub hexify { join ' ', map sprintf('%02X', ord), split //, $_[0] } { my $s = chr(0xE9); utf8::upgrade( my $u = $s ); utf8::downgrade( my $d = $s ); is( hexify(read_from_scalar($u)), hexify(read_from_scalar($d)), 'Unicode bug in :scalar read' ); } 1;Thread Previous | Thread Next