From e1f509efe72b433fdedea7ef24526b09934768d2 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Tue, 30 Mar 2021 12:32:42 -0700 Subject: Decode message bodies for replies in CommandRunner. --- Mailman/Queue/CommandRunner.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Mailman') diff --git a/Mailman/Queue/CommandRunner.py b/Mailman/Queue/CommandRunner.py index 6ea50255..a2a9dab7 100644 --- a/Mailman/Queue/CommandRunner.py +++ b/Mailman/Queue/CommandRunner.py @@ -100,6 +100,9 @@ class Results: # E.g the outer Content-Type: was text/html return body = part.get_payload(decode=True) + if (part.get_content_charset(None)): + body = unicode(body, part.get_content_charset()).encode( + Utils.GetCharSet(self.msgdata['lang'])) # text/plain parts better have string payloads assert isinstance(body, StringType) or isinstance(body, UnicodeType) lines = body.splitlines() -- cgit v1.2.3