Skip to content

Commit

Permalink
[DBManager] Fix encoding error if a field/table/database/file name co…
Browse files Browse the repository at this point in the history
…ntains unicode characters
  • Loading branch information
borysiasty committed Apr 26, 2018
1 parent 9ce55ca commit b822fe7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/plugins/db_manager/db_plugins/html_elems.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ def toHtml(self):
if hasattr(self.data, 'toHtml'):
return self.data.toHtml()

html = unicode(self.data).replace("\n", "<br>")
if isinstance(self.data, str):
html = unicode(self.data, encoding='utf-8', errors='replace')
else:
html = unicode(self.data)
html = html.replace("\n", "<br>")

return html

def hasContents(self):
Expand Down

0 comments on commit b822fe7

Please sign in to comment.