-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,11 @@ def data(self, index, role): | |
elif isinstance(val, (str, unicode)) and len(val) > 300: | ||
# too much data to display, elide the string | ||
return u"%s..." % val[:300] | ||
return unicode(val) # convert to string | ||
try: | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
m-kuhn
Member
|
||
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: | ||
|
Couldn't this be replaced with just a simple
return unicode(val, 'utf-8', 'replace')
instead of the whole try-catch thing?