diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2019-09-03 22:16:58 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2019-09-03 22:16:58 +0200 |
commit | e6f724d324490f0c762816e7fd63865bd4a1fd7d (patch) | |
tree | 3faa57735a629d8dcb011a5597a406c7052b6a8c | |
parent | 9b978cc5594d93e899deac78e9415c6ce01d25f0 (diff) | |
download | quilttools-e6f724d324490f0c762816e7fd63865bd4a1fd7d.tar.gz |
mb2q: Feed the supplied character set into the decoder
Otherwise the decoder fails to handle especially asian character sets.
Reported-by: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rwxr-xr-x | mb2q | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -309,7 +309,14 @@ class patchmsg(object): if not text: continue - text, patch = split_at_patch(text.decode()) + try: + charset = part.get_content_charset('ascii') + text, patch = split_at_patch(text.decode(charset)) + except: + err = 'Failed to decode body of Message-ID: %s\n' %self.msgid + sys.stderr.write(err) + return + self.text += text if patch: self.patch = patch |