all repos — cgit @ b6da53dd75a662f9a72163bc0f7052b5aa0d8d19

a hyperfast web frontend for git written in c

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>
Přemysl Janouch p.janouch@gmail.com
Wed, 11 Sep 2013 20:10:12 +0200
commit

b6da53dd75a662f9a72163bc0f7052b5aa0d8d19

parent

4f6fb32f5881a093be4c2f41c72813b80404c569

1 files changed, 1 insertions(+), 0 deletions(-)

jump to
M filters/syntax-highlighting.pyfilters/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])