Skip to content

Commit

Permalink
DBManager: fix int/float conversion to unicode (partially revert chan…
Browse files Browse the repository at this point in the history
…ges in 401f43c and fix #13505)
  • Loading branch information
brushtyler committed Oct 4, 2015
1 parent 01b4554 commit 396ec22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/plugins/db_manager/db_plugins/data_model.py
Expand Up @@ -76,7 +76,10 @@ def data(self, index, role):
elif isinstance(val, (str, unicode)) and len(val) > 300:
# too much data to display, elide the string
val = val[:300]
return unicode(val, 'utf-8', 'replace') # convert from utf8 and replace errors (if any)
try:
return unicode(val) # convert to unicode
except UnicodeDecodeError:
return unicode(val, 'utf-8', 'replace') # convert from utf8 and replace errors (if any)

def headerData(self, section, orientation, role):
if role != Qt.DisplayRole:
Expand Down

0 comments on commit 396ec22

Please sign in to comment.