X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FLog.pm;h=89b14d5d04d90642761dbe9ae3c8e7561ff50179;hb=206de410efd7d1d14692024275ff812b0e0dcbd4;hp=96748b7ee401813e6a096bf825a33122caca9daf;hpb=812f9b738effba6bdab70d527dae804192d1b2e8;p=debbugs.git diff --git a/Debbugs/Log.pm b/Debbugs/Log.pm index 96748b7..89b14d5 100644 --- a/Debbugs/Log.pm +++ b/Debbugs/Log.pm @@ -384,6 +384,9 @@ sub write_log_records for my $record (@records) { my $type = $record->{type}; croak "record type '$type' with no text field" unless defined $record->{text}; + # I am not sure if we really want to croak here; but this is + # almost certainly a bug if is_utf8 is on. + # croak "probably wrong encoding" if is_utf8($record->{text}); my ($text) = escape_log($record->{text}); if ($type eq 'autocheck') { print {$logfh} "\01\n$text\03\n" or @@ -428,7 +431,7 @@ Applies the log escape regex to the passed logfile. sub escape_log { my @log = @_; - return map { eval {$_ = is_utf8($_)?encode("utf8",$_,Encode::FB_CROAK):$_;}; s/^([\01-\07\030])/\030$1/gm; $_ } @log; + return map {s/^([\01-\07\030])/\030$1/gm; $_ } @log; }