if (self->Getarg)
arg = (*self->Getarg)(aTHX_ o, param, flags);
f = PerlIO_push(aTHX_ f, self, PerlIO_modestr(o,buf), arg);
+ if (PerlIOBase(o)->flags & PERLIO_F_UTF8)
+ PerlIOBase(f)->flags |= PERLIO_F_UTF8;
if (arg)
SvREFCNT_dec(arg);
}
no warnings 'once';
my $test = 1;
-print "1..26\n";
+print "1..29\n";
print "ok 1\n";
open(DUPOUT,">&STDOUT");
}
close G;
+ use utf8;
+ open UTFOUT, '>:utf8', "dup$$" or die $!;
+ open UTFDUP, '>&UTFOUT' or die $!;
+ my $message = "ça marche pas\n";
+ print UTFOUT $message;
+ print UTFDUP $message;
+ binmode UTFDUP, ':utf8';
+ print UTFDUP $message;
+ close UTFOUT;
+ close UTFDUP;
+ open(UTFIN, "<:utf8", "dup$$") or die $!;
+ {
+ my $line;
+ $line = <UTFIN>; is($line, $message);
+ $line = <UTFIN>; is($line, $message);
+ $line = <UTFIN>; is($line, $message);
+ }
+ close UTFIN;
+ no utf8;
+
END { 1 while unlink "dup$$" }
}