diff options
-rwxr-xr-x | contrib/hldiff.py | 1 | ||||
-rwxr-xr-x | contrib/plaintext.py | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/contrib/hldiff.py b/contrib/hldiff.py index 9c816630..5f660fd7 100755 --- a/contrib/hldiff.py +++ b/contrib/hldiff.py @@ -7,6 +7,7 @@ ansi_escape = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]') stat_re = re.compile(r'(| \d+ )(\+*)(\-*)') lines_re = re.compile(r'@@ (-\d+,\d+ \+\d+,\d+) @@') +sys.stdin.reconfigure(encoding='utf-8', errors='ignore') patch = sys.stdin.read().replace("\r\n", "\n") patch = ansi_escape.sub('', patch) diff --git a/contrib/plaintext.py b/contrib/plaintext.py index 3a326791..522055bf 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) |