As things stand you need to explicitly encode the data to utf8. To do that you need to use encode_utf8 rather than decode_utf8.
Change this line
print $fh $opts->{'data'};
to this
print $fh Encode::encode_utf8($opts->{'data'}) ;
In reply to Re: IO::Compress::Gzip and unicode
by pmqs
in thread IO::Compress::Gzip and unicode
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |