Skip to content

Commit

Permalink
opt-viewer: fix HtmlFormatter encoding
Browse files Browse the repository at this point in the history
Summary: Small fix to HtmlFormatter, defaults to ascii encoding, so utf-8 output may get `UnicodeEncodeError: 'ascii' codec can't encode character ... ordinal not in range(128)` during write.

Patch by Brian Cain!

Reviewers: anemet, fhahn

Reviewed By: anemet

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29802

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294710 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
anemet committed Feb 10, 2017
1 parent 8c54b81 commit 20a63f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/opt-viewer/opt-viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def __init__(self, source_dir, output_dir, filename):
</html>
'''.format(filename), file=self.stream)

self.html_formatter = HtmlFormatter()
self.html_formatter = HtmlFormatter(encoding='utf-8')
self.cpp_lexer = CppLexer()

def render_source_line(self, linenum, line):
Expand Down

0 comments on commit 20a63f1

Please sign in to comment.