From da8af582470ee67dae23330efdc70d048e30c359 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Sun, 5 Mar 2023 14:35:29 +0100 Subject: qmauth.py proper charset decoding --- script/qmauth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'script/qmauth.py') diff --git a/script/qmauth.py b/script/qmauth.py index 052b8dd..0c63c7d 100755 --- a/script/qmauth.py +++ b/script/qmauth.py @@ -202,7 +202,9 @@ def count_mails(f, subfolder): def _get_body(mail): if not mail.is_multipart(): if mail.get_content_maintype() == 'text': - return mail.get_payload(decode=True).decode(errors='replace') + return mail.get_payload(decode=True).decode( + encoding=mail.get_content_charset(failobj='utf-8'), + errors='replace') else: return mail.get_payload() -- cgit v1.2.3