mirror of
https://git.zx2c4.com/cgit
synced 2024-11-09 18:18:42 +00:00
syntax-highlighting: replace invalid unicode with ?
This commit is contained in:
parent
91153fd02e
commit
5564a5d066
@ -30,8 +30,8 @@ from pygments.lexers import guess_lexer_for_filename
|
|||||||
from pygments.formatters import HtmlFormatter
|
from pygments.formatters import HtmlFormatter
|
||||||
|
|
||||||
|
|
||||||
sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')
|
sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8', errors='replace')
|
||||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
|
||||||
data = sys.stdin.read()
|
data = sys.stdin.read()
|
||||||
filename = sys.argv[1]
|
filename = sys.argv[1]
|
||||||
formatter = HtmlFormatter(style='pastie')
|
formatter = HtmlFormatter(style='pastie')
|
||||||
|
Loading…
Reference in New Issue
Block a user