From 907d5f0887f52b6bb718d4ff2a58d3d214c480f8 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 2 Feb 2010 12:37:32 -0500 Subject: Fix be-xml-to-mbox handling of non-text/* content types --- misc/xml/be-xml-to-mbox | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'misc') diff --git a/misc/xml/be-xml-to-mbox b/misc/xml/be-xml-to-mbox index e2c8700..c8b7479 100755 --- a/misc/xml/be-xml-to-mbox +++ b/misc/xml/be-xml-to-mbox @@ -91,7 +91,8 @@ class Bug (LimitedAttrDict): print "Message-id: <%s@%s>" % (self["uuid"], DEFAULT_DOMAIN) print "Date: %s" % self["created"] print "From: %s" % self["creator"] - print "Content-Type: %s; charset=%s" % ("text/plain", DEFAULT_ENCODING) + print "Content-Type: %s; charset=%s" \ + % ("text/plain", DEFAULT_ENCODING) print "Content-Transfer-Encoding: 8bit" print "Subject: %s: %s" % (self["short-name"], self["summary"]) if "extra-strings" in self: @@ -168,11 +169,13 @@ class Comment (LimitedAttrDict): print "X-Extra-String: %s" % estr if self["content-type"].startswith("text/"): print "Content-Transfer-Encoding: 8bit" - print "Content-Type: %s; charset=%s" % (self["content-type"], DEFAULT_ENCODING) - print "" - print self["body"] - else: # content type and transfer encoding already in XML MIME output - print self["body"] + print "Content-Type: %s; charset=%s" \ + % (self["content-type"], DEFAULT_ENCODING) + else: + print "Content-Transfer-Encoding: base64" + print "Content-Type: %s;" % (self["content-type"]) + print "" + print self["body"] print "" def init_from_etree(self, element): assert element.tag == "comment", element.tag -- cgit