Commit | Line | Data |
---|---|---|
986a805c FC |
1 | #!./perl |
2 | ||
3 | BEGIN { | |
4 | unless ($] >= 5.008 and find PerlIO::Layer 'perlio') { | |
5 | print "1..0 # Skip: not perlio\n"; | |
6 | exit 0; | |
7 | } | |
8 | require($ENV{PERL_CORE} ? "../../t/test.pl" : "./t/test.pl"); | |
9 | } | |
10 | ||
11 | use utf8; | |
12 | ||
13 | ||
14 | plan(tests => 2); | |
15 | ||
16 | open my $fh, ">", 'io_utf8argv'; | |
17 | print $fh | |
18 | "\xce\x9c\xe1\xbd\xb7\xce\xb1\x20\xcf\x80\xe1\xbd\xb1\xcf\x80\xce". | |
19 | "\xb9\xce\xb1\x2c\x20\xce\xbc\xe1\xbd\xb0\x20\xcf\x80\xce\xbf\xce". | |
20 | "\xb9\xe1\xbd\xb0\x20\xcf\x80\xe1\xbd\xb1\xcf\x80\xce\xb9\xce\xb1". | |
21 | "\xcd\xbe\x0a"; | |
22 | close $fh or die "close: $!"; | |
23 | ||
24 | ||
25 | use open ":std", ":utf8"; | |
26 | ||
27 | use IO::Handle; | |
28 | ||
29 | @ARGV = ('io_utf8argv') x 2; | |
30 | is *ARGV->getline, "Μία πάπια, μὰ ποιὰ πάπια;\n", | |
31 | 'getline respects open pragma when magically opening ARGV'; | |
32 | ||
33 | is join('',*ARGV->getlines), "Μία πάπια, μὰ ποιὰ πάπια;\n", | |
34 | 'getlines respects open pragma when magically opening ARGV'; | |
35 | ||
36 | END { | |
37 | 1 while unlink "io_utf8argv"; | |
38 | } |