in reply to Re^2: Lost in compressed encodings
in thread Lost in compressed encodings
I think that IO::Uncompress::Gunzip only understands ->binmode() and not ->binmode(':utf8');. The documentation (now that I read it ...) even says:
This is a noop provided for completeness.
If you are able to install PerlIO::gzip, that one should work with stacking other decoding mechanisms on top of it.
If you have a gzip binary available, you can use that to decompress:
my $in; if( $filename =~ /\.gz$/ ) { open $fh, "gzip -cd "$filename" |' or die "Can't read from gzip $filename: $!/$?"; } else { open $in, '<:raw', $filename or die "Can't read $filename: $!\n"; }; binmode $fh, ':utf8';
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Lost in compressed encodings
by Skeeve (Parson) on Apr 06, 2020 at 09:19 UTC | |
by Tux (Canon) on Apr 06, 2020 at 10:49 UTC |
In Section
Seekers of Perl Wisdom