Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
X-RT-Interface: Web
Message-ID: <rt-4.0.18-11122-1387869851-1065.0-0-0 [...] rt.cpan.org>
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1387869851-11122-1"
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
Content-Length: 183
Download (untitled) / with headers
text/plain 183b
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
MIME-Version: 1.0
Content-Type: application/x-perl; name="encoding-problem.pl"
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline; filename="encoding-problem.pl"
Content-Transfer-Encoding: base64
Content-Length: 2295
Download encoding-problem.pl
text/x-perl 2.2k
#!/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
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-11122-1387869851-1065.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-11122-1387869851-1065.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-19424-1387872380-1696.91616-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 463
Download (untitled) / with headers
text/plain 463b
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


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.