DBManager: fix int/float conversion to unicode (partially revert changes in 401f43c and fix #13505)

This commit is contained in:
Giuseppe Sucameli 2015-10-04 18:02:14 +02:00
parent 01b4554079
commit 396ec2290b

View File

@ -76,7 +76,10 @@ class BaseTableModel(QAbstractTableModel):
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: