mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-19 10:53:55 +00: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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294710 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8c54b816e5
commit
20a63f1cc1
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user