From 32a9da31438d51bfd49b3acbf0691c35feb4a974 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 7 Jun 2019 10:18:46 -0400 Subject: Ignore encoding errors in filters Fixes #161 --- contrib/plaintext.py | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/plaintext.py') diff --git a/contrib/plaintext.py b/contrib/plaintext.py index 3a32679..522055b 100755 --- a/contrib/plaintext.py +++ b/contrib/plaintext.py @@ -11,6 +11,7 @@ ansi_escape = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]') quote_prefix_re = re.compile(r"On .*, .* wrote:") quote_re = re.compile(r">+") +sys.stdin.reconfigure(encoding='utf-8', errors='ignore') mail = sys.stdin.read().replace("\r\n", "\n") mail = ansi_escape.sub('', mail) -- cgit v1.2.3