Subject: | IO::Uncompress::Gunzip silently does not process utf8 strings |
Date: | Sat, 6 May 2017 18:39:26 +0200 |
To: | bug-IO-Compress [...] rt.cpan.org |
From: | Jeroen van Wolffelaar <jeroen.vanwolffelaar [...] booking.com> |
This is a bug report for perl from jeroen.vanwolffelaar@booking.com,
generated with the help of perlbug 1.39 running under perl 5.18.2.
-----------------------------------------------------------------
Calling
my $text = "This is the raw text";
gzip \$text, \my $gz or die;
my $utf8gz = $gz;
utf8::upgrade($utf8gz);
gunzip \$utf8gz => $filename|\$uncompressed_data;
succeeds (returns 1), while stuffing the input data into file
$filename/variable $uncompressed_data, not decompressing anything.
It should either decompress the string (even though it's wasteful/silly
that it
is utf8), or return an error. Considering that File::Slurp::write_file just
stuffs
the (utf8) data without complaining as bytes to a file, I'd expect gunzip
to treat
such utf8 variable exactly the same way and with the same interpretation.
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=library
severity=medium
module=IO::Uncompress::Gunzip
---
Site configuration information for perl 5.18.2:
Configured by root at Mon Feb 20 16:49:45 CET 2017.
Summary of my perl5 (revision 5 version 18 subversion 2) configuration:
Platform:
osname=linux, osvers=, archname=x86_64-linux
uname='linux gnulinux '
config_args=''
Compiler:
cc='gcc', ccflags ='',
optimize='-O2',
cppflags=''
ccversion='', gccversion='', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =''
libpth=/usr/lib64
libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl'
cccdlflags='-fPIC', lddlflags='-shared -O2 -fstack-protector'
Locally applied patches:
---
@INC for perl 5.18.2:
lib
---
Environment for perl 5.18.2:
HOME=/home/jvanwolffela
LANG=en_US.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/home/jvanwolffela/perl5/bin
PERL5LIB=lib
PERL_BADLANG (unset)
PERL_LOCAL_LIB_ROOT=/home/jvanwolffela/perl5:/home/jvanwolffela/perl5
PERL_MB_OPT=--install_base "/home/jvanwolffela/perl5"
PERL_MM_OPT=INSTALL_BASE=/home/jvanwolffela/perl5
SHELL=/bin/bash
--Jeroen