1 2
open my $fh, '>', $out_file; binmode $fh, ':encoding(UTF-8)';
View full thread Best practice UTF-8 Output