From: Gisle Aas Date: Fri, 3 Dec 2004 06:09:19 +0000 (-0800) Subject: :encoding(utf8) broken in perl-5.8.6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fbadb8fa63a268309e194a1a88ab374218e944d9;p=p5sagit%2Fp5-mst-13.2.git :encoding(utf8) broken in perl-5.8.6 Message-ID: p4raw-id: //depot/perl@23631 --- diff --git a/ext/PerlIO/t/encoding.t b/ext/PerlIO/t/encoding.t index 23266a0..80e2aff 100644 --- a/ext/PerlIO/t/encoding.t +++ b/ext/PerlIO/t/encoding.t @@ -16,7 +16,7 @@ BEGIN { } } -print "1..14\n"; +print "1..15\n"; my $grk = "grk$$"; my $utf = "utf$$"; @@ -150,6 +150,17 @@ close(F); print "not " unless ($dstr eq $str); print "ok 14\n"; +# Try decoding some bad stuff +open(F,'>:raw',$threebyte) || die "Cannot open $threebyte:$!"; +print F "foo\xF0\x80\x80\x80bar\n\x80foo\n"; +close(F); + +open(F,'<:encoding(utf-8)',$threebyte) || die "Cannot open $threebyte:$!"; +$dstr = join(":", ); +close(F); +print "not " unless $dstr eq "foo\\xF0\\x80\\x80\\x80bar\n:\\x80foo\n"; +print "ok 15\n"; + END { 1 while unlink($grk, $utf, $fail1, $fail2, $russki, $threebyte); }