From ed5850cfe50217f3bb27439a7742238fcd1dce5d Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 11 Jul 2021 18:29:57 -0700 Subject: [PATCH] update to work correctly with utf8 files --- dev-bin/side_comment_test.pl | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.39.5