my $output = decode_utf8('');
local $_ = $record->{type};
if (/html/) {
- my ($time) = $record->{text} =~ /<!--\s+time:(\d+)\s+-->/;
- my $class = $record->{text} =~ /^<strong>(?:Acknowledgement|Reply|Information|Report|Notification)/m ? 'infmessage':'msgreceived';
- $output .= decode_rfc1522($record->{text});
+ # $record->{text} is not in perl's internal encoding; convert it
+ my $text = decode_utf8($record->{text});
+ my ($time) = $text =~ /<!--\s+time:(\d+)\s+-->/;
+ my $class = $text =~ /^<strong>(?:Acknowledgement|Reply|Information|Report|Notification)/m ? 'infmessage':'msgreceived';
+ $output .= decode_rfc1522($text);
# Link to forwarded http:// urls in the midst of the report
# (even though these links already exist at the top)
$output =~ s,((?:ftp|http|https)://[\S~-]+?/?)((?:[\)\'\:\.\,]|\&\#39;)?(?:\s|\.<|$)),<a href=\"$1\">$1</a>$2,go;
write the .log files used by debbugs to store the complete textual records
of all bug transactions.
+Debbugs::Log does not decode utf8 into perl's internal encoding or
+encode into utf8 from perl's internal encoding. For html records and
+all recips, this should probably be done. For other records, this should
+not be needed.
+
=head2 The .log File Format
.log files consist of a sequence of records, of one of the following four
die "Unable to open bug log $bug_log for reading: $!";
}
- binmode($self->{logfh},':utf8');
$self->{state} = 'kill-init';
$self->{linenum} = 0;
return $self;