Skip Menu |

This queue is for tickets about the IO-Compress-Bzip2 CPAN distribution.

Report information
The Basics
Id: 99328
Status: resolved
Priority: 0/
Queue: IO-Compress-Bzip2

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

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



CC: smash [...] cpan.org
Subject: Wide character in print
Hello I think (not 100% sure, though) that this is a regression, as I think this worked previously. In any case, when writing UTF8 to a Bz2 file, it complains with a wide character in print. a simple test in attach. The question is: how to solve this? ;-) Cheers ambs
Subject: _.pl
#!/usr/bin/perl use IO::Compress::Bzip2; use utf8; my $str = "ãíòÃçyŏ"; my $z = new IO::Compress::Bzip2 "tmp.bz2" or die; select $z; binmode $z, ":utf8"; #noop accordingly with docs print $str; close $z;
On Mon Oct 06 11:40:55 2014, AMBS wrote: Show quoted text
> Hello > > I think (not 100% sure, though) that this is a regression, as I think > this worked previously. In any case, when writing UTF8 to a Bz2 file, > it complains with a wide character in print. > > a simple test in attach. > > The question is: how to solve this? ;-)
As the attachment got double encoded by RT, in attach a gziped version of the file (should be fine).
Subject: _.pl.gz
Download _.pl.gz
application/x-gzip 193b

Message body not shown because it is not plain text.

Just tried the script on a standard Redhat Perl (5.10.1) and it didn't complain about wide characters. Can you get me the versions of Perl & the IO::Compress::Bzip2 module you are running please? I'll try to match your setup & see if I can reproduce the issue. Paul
On Mon Oct 06 12:33:33 2014, PMQS wrote: Show quoted text
> Just tried the script on a standard Redhat Perl (5.10.1) and it didn't > complain about wide characters. > > Can you get me the versions of Perl & the IO::Compress::Bzip2 module > you are running please? I'll try to match your setup & see if I can > reproduce the issue.
Sure, sorry I forgot that. Also, that is probably the reason it worked previously... I am running v5.20.1, on Mac OS X. IO::Compress::Bzip2 is version 2.066. Thanks,
... Show quoted text
> > Sure, sorry I forgot that. Also, that is probably the reason it worked > previously... > > I am running v5.20.1, on Mac OS X. IO::Compress::Bzip2 is version > 2.066. > > Thanks,
Thanks - will give that a go later. Don't have a Mac but can try to match the versions of Perl & the IO module. Paul
CC: Alberto Simões <ambs [...] cpan.org>
Subject: Re: [rt.cpan.org #99328] Wide character in print
Date: Mon, 6 Oct 2014 17:44:38 +0100
To: bug-IO-Compress-Bzip2 [...] rt.cpan.org
From: Nuno Carvalho <smash [...] cpan.org>
Hello, On Mon, Oct 6, 2014 at 5:35 PM, Alberto Simões via RT <bug-IO-Compress-Bzip2@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=99328 > > > On Mon Oct 06 12:33:33 2014, PMQS wrote:
>> Just tried the script on a standard Redhat Perl (5.10.1) and it didn't >> complain about wide characters. >> >> Can you get me the versions of Perl & the IO::Compress::Bzip2 module >> you are running please? I'll try to match your setup & see if I can >> reproduce the issue.
> > Sure, sorry I forgot that. Also, that is probably the reason it worked previously... > > I am running v5.20.1, on Mac OS X. IO::Compress::Bzip2 is version 2.066.
I'm getting the the same complaint, running on perl 5.16.2, on Mac OS X 10.9.5, and my IO::Compress::Bzip2 is also 2.066. _But_ if I run _.pl in a Debian (perl v5.14.2, IO::Compress::Bzip2 v2.0.58) it works fine. Something specific to Mac OS X? Show quoted text
> Thanks,
Thank you
Show quoted text
> > Something specific to Mac OS X?
Perl 5.20.0, linux, still fails. So probably something changed between 5.14 and 5.16?
With IO::Compress::Bzip2 constant at version 2.066 I've reproduced the issue with all perl's back to 5.8.0 on a Linux setup, so possibly something I've changed in IO::Compress Need to work backwards from 2.066 to see if there's a change I've made that is triggering the issue Paul
OK - I figured out what change is triggering the "wide character" warning you are seeing. In 2.059 I added the Encode option. To make that happen I had to remove a "use bytes" pragma in the code. That change is triggering the "wide character" warning. If the IO@@Compress tied filenamdle could deal with LAYERS, then the binmode line you had in your code (below) would make the problem go away. binmode $z, ":utf8"; To silence the warning use the new Encode option when you create the bzip2 object, like this my $z = new IO::Compress::Bzip2 "tmp.bz2", Encode => 'utf8' or die;
Show quoted text
> > my $z = new IO::Compress::Bzip2 "tmp.bz2", Encode => 'utf8' > or die;
Hello, Paul. Thanks for your help on digging this.
marking this as resolved. Please reopen if you have any further issues. Paul