forked from extern/django-helpdesk
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:
parent
30a577e18b
commit
43658abad9
@ -135,9 +135,9 @@ def process_queue(q, quiet=False):
|
|||||||
def decodeUnknown(charset, string):
|
def decodeUnknown(charset, string):
|
||||||
if not charset:
|
if not charset:
|
||||||
try:
|
try:
|
||||||
return string.decode('utf-8')
|
return string.decode('utf-8','ignore')
|
||||||
except:
|
except:
|
||||||
return string.decode('iso8859-1')
|
return string.decode('iso8859-1','ignore')
|
||||||
return unicode(string, charset)
|
return unicode(string, charset)
|
||||||
|
|
||||||
def decode_mail_headers(string):
|
def decode_mail_headers(string):
|
||||||
|
Loading…
Reference in New Issue
Block a user