Fix UTF-8 with syntax-highlighting.py

Previously the script tried to encode output from Pygments with
the ASCII codec, which failed.

Signed-off-by: Přemysl Janouch <p.janouch@gmail.com>
This commit is contained in:
Přemysl Janouch 2013-09-11 20:10:12 +02:00 committed by Jason A. Donenfeld
父節點 4f6fb32f58
當前提交 b6da53dd75
共有 1 個文件被更改,包括 1 次插入0 次删除

查看文件

@ -25,6 +25,7 @@ from pygments import highlight
from pygments.formatters import HtmlFormatter
sys.stdin = codecs.getreader("utf-8")(sys.stdin.detach())
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
doc = sys.stdin.read()
try:
lexer = get_lexer_for_filename(sys.argv[1])