diff --git a/django_mailbox/models.py b/django_mailbox/models.py index 4c76dc5..8ab6ce1 100644 --- a/django_mailbox/models.py +++ b/django_mailbox/models.py @@ -374,6 +374,12 @@ def _get_dehydrated_message(self, msg, record): 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 diff --git a/django_mailbox/utils.py b/django_mailbox/utils.py index 5805211..de624a8 100644 --- a/django_mailbox/utils.py +++ b/django_mailbox/utils.py @@ -78,6 +78,8 @@ def _decode(value, encoding): 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: