From 1fb74d8b84422593bfc1bc12e3a445f6053cb408 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 3 Apr 2020 08:38:07 -0700 Subject: [PATCH] add encoding guess log message --- lib/Perl/Tidy.pm | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 37ad2249..f2b5094f 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -912,6 +912,7 @@ EOM # Decode the input stream if necessary requested my $encoding_in = ""; my $rOpts_character_encoding = $rOpts->{'character-encoding'}; + my $encoding_log_message; # Case 1. See if we already have an encoded string. In that # case, we have to ignore any encoding flag. @@ -949,12 +950,19 @@ EOM if ( $encoding_in !~ /^(UTF-8|utf8)$/ ) { $encoding_in = ""; $buf = $buf_in; + $encoding_log_message .= <decode($buf_in); }; if ($@) { + $encoding_log_message .= <write_logfile_entry($encoding_log_message) + if $encoding_log_message; + if ( ${$rpending_logfile_message} ) { $logger_object->write_logfile_entry( ${$rpending_logfile_message} ); } -- 2.39.5