--- spambayes-1.0.3/spambayes/ProxyUI.py.orig 2005-01-28 10:23:02.000000000 +0900 +++ spambayes-1.0.3/spambayes/ProxyUI.py 2005-02-02 19:50:40.000000000 +0900 @@ -325,6 +325,10 @@ # is no link to the body. h = self.html.reviewRow.linkedHeaderValue.clone() h.text.title = messageInfo.bodySummary + # support iso-2022-jp (2005-02-02 by owa) + text = str(unicode(text, errors='ignore')) + u = unicode(h.text.title, 'iso-2022-jp', 'ignore') + h.text.title = u.encode('utf-8', 'replace') h.text.href = "view?key=%s&corpus=%s" % (key, label) else: h = self.html.reviewRow.headerValue.clone() @@ -660,10 +664,20 @@ bodySummary and other header (as needed) attributes. These objects are passed into appendMessages by onReview - passing email.Message objects directly uses too much memory.""" - subjectHeader = message["Subject"] or "(none)" - headers = {"subject" : subjectHeader} + # support iso-2022-jp (2005-02-02 by owa) + headers = {} for header in options["html_ui", "display_headers"]: headers[header.lower()] = (message[header] or "(none)") + subjectHeader = message["Subject"] or "(none)" + from email.Header import decode_header + us = '' + for hs, hc in decode_header(subjectHeader): + if hc: + us += unicode(hs, hc, 'ignore').encode('utf-8', 'replace') + else: + us += hs + headers['subject'] = us + score = message[options["Headers", "score_header_name"]] if score: # the score might have the log info at the end