Skip to content

Commit

Permalink
Merge pull request #6871 from borysiasty/dbmanager_unicode_fix
Browse files Browse the repository at this point in the history
[DBManager] Fix encoding error if a field/table/database/file name co…
  • Loading branch information
borysiasty committed Apr 27, 2018
2 parents 9ce55ca + e5aaf6a commit 85fd681
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/plugins/db_manager/db_plugins/html_elems.py
Expand Up @@ -36,7 +36,14 @@ 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')
elif isinstance(self.data, unicode):
html = self.data
else:
html = unicode(self.data)
html = html.replace("\n", "<br>")

return html

def hasContents(self):
Expand Down

0 comments on commit 85fd681

Please sign in to comment.