Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 91616
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: zmughal [...] cpan.org
Cc: zmughal [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 2.55
  • 2.56
Fixed in: (no value)



CC: zmughal [...] cpan.org
Subject: Regression in decode_utf8
Hello, I believe I have come across a regression in the decode_utf8 function. I have attached the output of different versions of Encode along with an example. Cheers, - Zaki Mughal
Subject: encoding-problem.pl
#!/usr/bin/env perl use strict; use Encode qw(decode_utf8 decode); binmode STDOUT, ":encoding(UTF-8)"; print "$^V : $Encode::VERSION\n"; print decode_utf8("\x{0ED5}\x{0ED7}\x{0ED6}"), "\n"; __END__ __OUTPUT__ perl-5.16.3 ========== v5.16.3 : 2.44_01 ໕໗໖ perl-5.16.3 ========== v5.16.3 : 2.51 ໕໗໖ perl-5.16.3 ========== Cannot decode string with wide characters at /home/zaki/.perlbrew/libs/perl-5.16.3@encode-2.55/lib/perl5/x86_64-linux/Encode.pm line 215. v5.16.3 : 2.55 Command [perl encoding-problem.pl] terminated with exit code 25 ($? = 6400) under the following perl environment: Command terminated with non-zero status. Current perl: Name: perl-5.16.3@encode-2.55 Path: /home/zaki/perl5/perlbrew/perls/perl-5.16.3/bin/perl Config: -de -Dprefix=/home/zaki/perl5/perlbrew/perls/perl-5.16.3 -Aeval:scriptdir=/home/zaki/perl5/perlbrew/perls/perl-5.16.3/bin Compiled at: Mar 16 2013 16:39:59 perlbrew: version: 0.66 ENV: PERLBREW_ROOT: /home/zaki/perl5/perlbrew PERLBREW_HOME: /home/zaki/.perlbrew PERLBREW_PATH: /home/zaki/.perlbrew/libs/perl-5.16.3@encode-2.55/bin:/home/zaki/perl5/perlbrew/bin:/home/zaki/perl5/perlbrew/perls/perl-5.16.3/bin PERLBREW_MANPATH: /home/zaki/.perlbrew/libs/perl-5.16.3@encode-2.55/man:/home/zaki/perl5/perlbrew/perls/perl-5.16.3/man perl-5.16.3 ========== Cannot decode string with wide characters at /home/zaki/.perlbrew/libs/perl-5.16.3@junk/lib/perl5/x86_64-linux/Encode.pm line 215. v5.16.3 : 2.56 Command [perl encoding-problem.pl] terminated with exit code 25 ($? = 6400) under the following perl environment: Command terminated with non-zero status. Current perl: Name: perl-5.16.3@junk Path: /home/zaki/perl5/perlbrew/perls/perl-5.16.3/bin/perl Config: -de -Dprefix=/home/zaki/perl5/perlbrew/perls/perl-5.16.3 -Aeval:scriptdir=/home/zaki/perl5/perlbrew/perls/perl-5.16.3/bin Compiled at: Mar 16 2013 16:39:59 perlbrew: version: 0.66 ENV: PERLBREW_ROOT: /home/zaki/perl5/perlbrew PERLBREW_HOME: /home/zaki/.perlbrew PERLBREW_PATH: /home/zaki/.perlbrew/libs/perl-5.16.3@junk/bin:/home/zaki/perl5/perlbrew/bin:/home/zaki/perl5/perlbrew/perls/perl-5.16.3/bin PERLBREW_MANPATH: /home/zaki/.perlbrew/libs/perl-5.16.3@junk/man:/home/zaki/perl5/perlbrew/perls/perl-5.16.3/man
It is because the previous version of decode_utf8() was a no-op on already decoded string, WHICH IS CONSIDERED BUGGY since decode("UTF8", $s) returns an error when $s is already decoded. Dan the Maintainer Thereof On Tue Dec 24 02:24:11 2013, ZMUGHAL wrote: Show quoted text
> Hello, > > I believe I have come across a regression in the decode_utf8 function. > I have > attached the output of different versions of Encode along with an > example. > > Cheers, > - Zaki Mughal