- or download this
open(my $fh, '>', ...) or die ...;
my $buf = encode('UTF-8', $text);
sysrwite($fh, $buf); # Or: print $fh $buf;
- or download this
open(my $fh, '>:encoding(UTF-8)', ...) or die ...;
sysrwite($fh, $text); # Or: print $fh $text;
- or download this
binmode($fh, ':encoding(UTF-8)');
sysrwite($fh, $text); # Or: print $fh $text;