Update helpdesk/management/commands/get_email.py

ignore when some characters can't be decoded to avoid unicode decode error.
This commit is contained in:
satyans24 2012-10-09 21:04:20 +05:30
parent 30a577e18b
commit 43658abad9

View File

@ -135,9 +135,9 @@ def process_queue(q, quiet=False):
def decodeUnknown(charset, string):
if not charset:
try:
return string.decode('utf-8')
return string.decode('utf-8','ignore')
except:
return string.decode('iso8859-1')
return string.decode('iso8859-1','ignore')
return unicode(string, charset)
def decode_mail_headers(string):