I deal with files with GBK/GB2312 encoding a lot. Sometimes it occurs so weird that my Perl scripts got stuck while the CPU usage running up to 100%.
Steps to Reproduce
use warnings;
use strict;
my $fname = "\x{00be}\x{02c9}\x{00b8}\x{00e6}\x{00d7}a\x{00bb}\x{00bb}\x{00cf}\x{00df}.pl";
open F, '>', $fname or die "$!";
print F while (<DATA>);
close F;
system("perl $fname");
__END__
use warnings;
use strict;
use Data::Dumper;
binmode STDERR, ":encoding(GBK)";
# binmode STDERR, ":crlf";
print Dumper(\$0);
my $fname = "\x{00be}\x{02c9}\x{00b8}\x{00e6}\x{00d7}a\x{00bb}\x{00bb}\x{00cf}\x{00df}.pl";
die "$fname";
It seems to not output the error instead of dying if I do use PerlIO::encoding; $PerlIO::encoding::fallback = Encode::FB_CROAK|Encode::STOP_AT_PARTIAL; before the binmode. I'm pretty sure this is a problem in Encode @dankogai
Module:
Description
I deal with files with GBK/GB2312 encoding a lot. Sometimes it occurs so weird that my Perl scripts got stuck while the CPU usage running up to 100%.
Steps to Reproduce
Expected behavior
Perl configuration