From b6da53dd75a662f9a72163bc0f7052b5aa0d8d19 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Wed, 11 Sep 2013 20:10:12 +0200 Subject: Fix UTF-8 with syntax-highlighting.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the script tried to encode output from Pygments with the ASCII codec, which failed. Signed-off-by: Přemysl Janouch --- filters/syntax-highlighting.py | 1 + 1 file changed, 1 insertion(+) (limited to 'filters/syntax-highlighting.py') diff --git a/filters/syntax-highlighting.py b/filters/syntax-highlighting.py index dcdba03..72d9097 100755 --- a/filters/syntax-highlighting.py +++ b/filters/syntax-highlighting.py @@ -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]) -- cgit v1.2.3-59-g8ed1b