I'm writing a Google App engine app that processes incoming mail, and here's the code I'm currently using to process mail messages:
for content_type, body in email_bodies:
#8bit bug in mail messages - see bug report here
#http://code.google.com/p/googleappengine/issues/detail?id=2383
if body.encoding == '8bit':
body.encoding = '7bit'
#test for html content
if content_type == "text/html":
#parse html result
if content_type == "text/plain":
decoded_msg_body = body.decode()
However I just got a message that was using the binary encoding scheme, and when my program tried to process the message using body.decode(), I received a UnknownEncodingError. How should this program parse the binary content type? Also, how can I imitate this message type on my local version of GAE so I can debug and test it out?
I appreciate your help, Kevin