Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit b028797

Browse files
committed
Replace invalid UTF-8 codepoints
1 parent 230ed67 commit b028797

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

emailthreads/threads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def normalize_whitespace(text):
4141

4242
def get_text(msg):
4343
text_part = get_text_part(msg)
44-
text = text_part.get_payload(decode=True).decode('utf-8', 'ignore')
44+
text = text_part.get_payload(decode=True).decode('utf-8', 'replace')
4545
text = normalize_whitespace(text)
4646
return text
4747

emailthreads/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def normalize_whitespace(text):
3636

3737
def get_text(msg):
3838
text_part = get_text_part(msg)
39-
text = text_part.get_payload(decode=True).decode('utf-8')
39+
text = text_part.get_payload(decode=True).decode('utf-8', 'replace')
4040
text = normalize_whitespace(text)
4141
return text
4242

0 commit comments

Comments
 (0)