Skip Menu |
 

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 124094
Status: open
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: manabe.hiroshi [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.94
Fixed in: (no value)



Subject: Program gets stuck when trying to read an illegal iso-2022-jp file
Download (untitled) / with headers
text/plain 174b
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>;'
Download (untitled) / with headers
text/plain 984b
On Mon Jan 15 23:52:45 2018, manabe.hiroshi@gmail.com wrote: Show quoted text
> 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>;'
On Tue, Jan 16, 2018 at 7:56 AM Hiroshi Manabe <perlbug-followup@perl.org> wrote: Show quoted text
> 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 core's 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). Leon


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.