]> git.donarmstrong.com Git - debbugs.git/commitdiff
git rid of encoding in Debbugs::Log; everything should be escaped before here.
authorDon Armstrong <don@donarmstrong.com>
Sun, 8 Jul 2012 16:12:59 +0000 (09:12 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sun, 8 Jul 2012 16:12:59 +0000 (09:12 -0700)
Debbugs/Log.pm

index 96748b7ee401813e6a096bf825a33122caca9daf..89b14d5d04d90642761dbe9ae3c8e7561ff50179 100644 (file)
@@ -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;
 }