develooper Front page | perl.perl5.porters | Postings from April 2019

[perl #132724] Program gets stuck when trying to read an illegaliso-2022-jp file

From:
Karl Williamson via RT
Date:
April 4, 2019 20:31
Subject:
[perl #132724] Program gets stuck when trying to read an illegaliso-2022-jp file
Message ID:
rt-4.0.24-31163-1554409884-859.132724-15-0@perl.org
On Sat, 15 Sep 2018 09:39:31 -0700, LeonT wrote:
> On Tue, Jan 16, 2018 at 7:56 AM Hiroshi Manabe
> <perlbug-followup@perl.org> wrote:
> > You can reproduce the bug with the following procedure:
> > 1. perl -e 'print "\x8f";' > temp.txt
> > 2. perl -e 'open my $in, "<:encoding(iso-2022-jp)", "temp.txt"; print
> > <$in>;'
> 
> Given that this one-liner doesn't hang:
>   perl -MEncode -e 'decode("iso-2022-jp", "\x8f", Encode::FB_CROAK |
> Encode::LEAVE_SRC)'
> I'm pretty sure the issue is in PerlIO::encoding, not in Encode. Which
> means it's a bug on our side, not Encode's.
> 
> I assume "\x8f" is the start of a multi-byte character. :encoding
> doesn't handle such errors at the end of a file well (I think there's
> a already a ticket about this but I can't find it, though I'm sure
> #84250 is related).
> 
> I think I know how to fix this though.
> 
> Leon

Any progress on this?
-- 
Karl Williamson

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=132724



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About