mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
DBManager: fix int/float conversion to unicode (partially revert changes in 401f43c and fix #13505)
This commit is contained in:
parent
01b4554079
commit
396ec2290b
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user