#!/usr/bin/env perl
use utf8; #this causes error
use strict;
use warnings;
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
my $zip = Archive::Zip->new();
my $my_string_with_utf8 = <<'END_UTF8_STRING';
Text with UTF8 open/close 201c/201d “hello”
END_UTF8_STRING
my $zip_pathname = 'myfiles/myfile.txt';
$zip->addString($my_string_with_utf8, $zip_pathname);
unless ( $zip->writeToFileNamed('myZip.zip') == AZ_OK ) {
die 'write error';
}
Error: Wide character in Compress::Raw::Zlib::crc32
Why does utf8 cause error in these package? perl5/vendor_perl/Archive/Zip.pm line 303