mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-10 06:48:19 +02:00
Merge 6f2113a064 into eec7fb76f9
This commit is contained in:
commit
5427b059cf
2 changed files with 8 additions and 0 deletions
|
|
@ -374,6 +374,12 @@ class Mailbox(models.Model):
|
|||
content_charset = msg.get_content_charset()
|
||||
if not content_charset:
|
||||
content_charset = 'ascii'
|
||||
elif content_charset == 'iso-8859-8-i':
|
||||
content_charset = 'iso-8859-8'
|
||||
logger.warning(
|
||||
"Unhandled encoding %s; interpreting as iso-8859-8",
|
||||
content_charset
|
||||
)
|
||||
try:
|
||||
# Make sure that the payload can be properly decoded in the
|
||||
# defined charset, if it can't, let's mash some things
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ def convert_header_to_unicode(header):
|
|||
return value
|
||||
if not encoding or encoding == 'unknown-8bit':
|
||||
encoding = default_charset
|
||||
elif encoding == 'iso-8859-8-i':
|
||||
encoding = 'iso-8859-8'
|
||||
return value.decode(encoding, 'replace')
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue