syntax-highlighting: replace invalid unicode with ?

Cette révision appartient à :
Jason A. Donenfeld 2017-01-22 12:44:44 +01:00
Parent 91153fd02e
révision 5564a5d066

Voir le fichier

@ -30,8 +30,8 @@ from pygments.lexers import guess_lexer_for_filename
from pygments.formatters import HtmlFormatter
sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')
sys.stdout = io.TextIOWrapper(sys.stdout.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', errors='replace')
data = sys.stdin.read()
filename = sys.argv[1]
formatter = HtmlFormatter(style='pastie')