1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

opt-viewer: fix HtmlFormatter encoding

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

llvm-svn: 294710
This commit is contained in:
Adam Nemet 2017-02-10 04:50:18 +00:00
parent b256ef8c46
commit 105c1f8b7f

View File

@ -183,7 +183,7 @@ class SourceFileRenderer:
</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):