summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-02-26 14:39:28 -0800
committerDylan Baker <dylan@pnwbakers.com>2018-03-01 10:34:56 -0800
commit4ba7a80a0c057dbc9081617b6703a0f75262459c (patch)
treec0623f7b0c71407369815ae9554ad03290e2eaa5 /alot
parent9e1b01c83df7e1aff048b1a341bbba2642bd5ae7 (diff)
If there are errors in the decoding the content replace
I've run into a couple of emails now with badly formatted utf-8, so let's use `errors='replace'`.
Diffstat (limited to 'alot')
-rw-r--r--alot/db/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/alot/db/utils.py b/alot/db/utils.py
index 3244be13..2b3dab24 100644
--- a/alot/db/utils.py
+++ b/alot/db/utils.py
@@ -352,7 +352,7 @@ def extract_body(mail, types=None, field_key='copiousoutput'):
continue
enc = part.get_content_charset() or 'ascii'
- raw_payload = part.get_payload(decode=True).decode(enc)
+ raw_payload = part.get_payload(decode=True).decode(enc, errors='replace')
if ctype == 'text/plain':
body_parts.append(string_sanitize(raw_payload))