From: Steve Hancock Date: Fri, 3 Apr 2020 15:38:07 +0000 (-0700) Subject: add encoding guess log message X-Git-Tag: 20200619~103 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1fb74d8b84422593bfc1bc12e3a445f6053cb408;p=perltidy.git add encoding guess log message --- 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} ); }