perl -e ' use IO::Uncompress::Gunzip; use Encode; binmode(STDOUT, ":utf8"); open my $in, "<:utf8", "umlaut"; $_=<$in>; print "Uncompressed: $_ ",ord($_),"\n"; my $gin= IO::Uncompress::Gunzip->new("umlaut.gz"); binmode($gin, ":utf8"); $_=<$gin>; print " Compressed: $_ ",ord($_),"\n"; $_ = decode("utf-8", $_); print " Decoded: $_ ",ord($_),"\n"; ' #### Uncompressed: ü 252 Compressed: ü 195 Decoded: ü 252