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