1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00

Cast iso-8859-8-i down to iso-8859-8

Attempt to do a better job than simply treating the email as ASCII
This commit is contained in:
ptav 2024-10-03 14:19:30 +01:00 committed by GitHub
parent ea0cf58bf1
commit 6f2113a064
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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