diff options
author | Jason A. Donenfeld | 2017-01-22 12:44:44 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2017-01-22 12:44:44 +0100 |
commit | 5564a5d06678b3f9b0725bc4b2383ea1b7eb5515 (patch) | |
tree | 6a316698ab978214f69dc1a948929efaa88634fa | |
parent | git: update to v2.11.0 (diff) | |
download | cgit-5564a5d06678b3f9b0725bc4b2383ea1b7eb5515.tar.gz cgit-5564a5d06678b3f9b0725bc4b2383ea1b7eb5515.zip |
syntax-highlighting: replace invalid unicode with ?
-rwxr-xr-x | filters/syntax-highlighting.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/filters/syntax-highlighting.py b/filters/syntax-highlighting.py index 1ca4108..5888b50 100755 --- a/filters/syntax-highlighting.py +++ b/filters/syntax-highlighting.py | |||
@@ -30,8 +30,8 @@ from pygments.lexers import guess_lexer_for_filename | |||
30 | from pygments.formatters import HtmlFormatter | 30 | from pygments.formatters import HtmlFormatter |
31 | 31 | ||
32 | 32 | ||
33 | sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8') | 33 | sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8', errors='replace') |
34 | sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') | 34 | sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace') |
35 | data = sys.stdin.read() | 35 | data = sys.stdin.read() |
36 | filename = sys.argv[1] | 36 | filename = sys.argv[1] |
37 | formatter = HtmlFormatter(style='pastie') | 37 | formatter = HtmlFormatter(style='pastie') |