From f9b2e1368014673803a5684f9ae3c2e1e0628853 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 13 Mar 2013 00:01:27 +0800 Subject: Bug 839357: bugmail syslog logging is throwing "Wide character in syswrite" --- extensions/BMO/Extension.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'extensions') diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index e40e4eb15..8cd722547 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -40,7 +40,7 @@ use Bugzilla::Util; use Scalar::Util qw(blessed); use Date::Parse; use DateTime; -use Encode qw(find_encoding decode_utf8); +use Encode qw(find_encoding encode_utf8); use Sys::Syslog qw(:DEFAULT setlogsock); use Bugzilla::Extension::BMO::Constants; @@ -936,12 +936,13 @@ sub _log_sent_email { } else { $message_type = $email->header('X-Bugzilla-Watch-Reason'); } + $message_type =~ s/^(\S+)\s.+$/$1/; $message_type ||= '?'; $subject =~ s/[\[\(]Bug \d+[\]\)]\s*//; openlog('apache', 'cons,pid', 'local4'); - syslog('notice', decode_utf8("[bugmail] $recipient ($message_type) $bug_id $subject")); + syslog('notice', encode_utf8("[bugmail] $recipient ($message_type) $bug_id $subject")); closelog(); } -- cgit v1.2.3-24-g4f1b