From: Steve Hancock Date: Mon, 12 Jul 2021 01:29:57 +0000 (-0700) Subject: update to work correctly with utf8 files X-Git-Tag: 20210717~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ed5850cfe50217f3bb27439a7742238fcd1dce5d;p=perltidy.git update to work correctly with utf8 files --- diff --git a/dev-bin/side_comment_test.pl b/dev-bin/side_comment_test.pl index 5daeec4a..13e22763 100755 --- a/dev-bin/side_comment_test.pl +++ b/dev-bin/side_comment_test.pl @@ -122,6 +122,9 @@ sub add_side_comments { sub write_file { my ( $fname, $string, $msg ) = @_; open my $fh, '>', $fname or die "cannot open $fname: $!\n"; + if ( utf8::is_utf8($string) ) { + binmode $fh, ":raw:encoding(UTF-8)"; + } $fh->print($string); $fh->close(); print STDERR "Wrote $fname\n" if ($msg);