From 204d67a57d9a78d4cf048eddca405f982b2da4b2 Mon Sep 17 00:00:00 2001 From: Manuel Gomez <34234948+lologf@users.noreply.github.com> Date: Fri, 24 May 2019 13:08:05 +0200 Subject: [PATCH] Update models.py --- django_mailbox/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_mailbox/models.py b/django_mailbox/models.py index 1ed7244..c3bf09b 100644 --- a/django_mailbox/models.py +++ b/django_mailbox/models.py @@ -385,7 +385,7 @@ class Mailbox(models.Model): # Fix to accept subject emojis in utf-8 if 'subject' in message: msg.subject = ( - utils.convert_header_to_unicode(message['subject'].encode('raw-unicode-escape'))[0:255] + utils.convert_header_to_unicode(message['subject'].decode('raw-unicode-escape'))[0:255] ) msg.subject = unicode(email.header.decode_header(msg.subject)[0][0], errors='ignore') if 'message-id' in message: