Leont/perlio-utf8_strict — Issue #1: PerlIO::scalar
Author: chansen
Created: 2012-03-08 10:29:10+00:00
State: open

PerlIO::scalar doesn't set the PERLIO_F_EOF flag, since we rely on `PerlIO_eof()` we fail to detect incomplete sequences at EOF.

```
open my $fh, "<:utf8_strict", \"\xE2\x98"; # Incomplete 3 octet sequence
my $string = do { local $/; <$fh> };
```

The above should fail but doesn't due to the EOF flag isn't set.

`pp_eof`[1] calls `Perl_do_eof ()`[2] which determines EOF using `PerlIO_getc()` and `PerlIO_ungetc()`.

We need to implement a workaround for `PerlIO::scalar`.

--
chansen

[1]: https://github.com/mirrors/perl/blob/blead/pp_sys.c#L2037
[2]: https://github.com/mirrors/perl/blob/blead/doio.c#L990