Subject: | decode deletes input data when CHECK = Encode::FB_CROAK |
Date: | Thu, 30 Apr 2009 18:17:02 +0200 |
To: | <bug-Encode [...] rt.cpan.org> |
From: | <g.zumstrull [...] rheinenergie.com> |
After calling decode(ENCODING, $octets, Encode::FB_CROAK) the string $octets is the empty string. This doesn't happen with other CHECKs but FB_CROAK.
Show quoted text
> # Example 1: FB_PERLQQ, prints blabla as expected
> perl -e 'use Encode; my $octets = "blabla"; decode("utf8", $octets, Encode::FB_PERLQQ); print "$octets\n";'
blabla
Show quoted text> # Example 2: wrong UTF-8, FB_CROAK, dies as expected
> perl -e 'use Encode; my $octets = "bläblä"; decode("utf8", $octets, Encode::FB_CROAK); print "$octets\n";'
utf8 "\xE4" does not map to Unicode at /usr/lib/perl5/5.10/i686-cygwin/Encode.pm line 163.
Show quoted text> # Example 3: UTF-8 ok, FB_CROAK, prints empty line => wrong
> perl -e 'use Encode; my $octets = "blabla"; decode("utf8", $octets, Encode::FB_CROAK); print "$octets\n";'
Show quoted text> perl -e 'use Encode; my $octets = "blabla"; decode("utf8", $octets, Encode::FB_CROAK); print (defined $octets? "yes\n": "no\n");'
yes
Show quoted text> perl -e 'use Encode; my $octets = "blabla"; decode("utf8", $octets, Encode::FB_CROAK); print ($octets eq ""? "yes\n": "no\n");'
yes
Encode-2.25
Perl 5.10
CYGWIN_NT-5.1 sys-15192 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin