Unicode conversion would fail if the data was a string encoded with utf-8.

This commit is contained in:
Louis-Dominique Dubeau
2013-11-09 15:27:58 -05:00
parent 8a4af08bea
commit 3e58a18de0
+1 -1
View File
@@ -43,7 +43,7 @@ class Column(object):
limit = getattr(self, "limit")
if limit:
# The value is not necessarily a string, so...
col["value"] = unicode(col["value"])
col["value"] = unicode(col["value"], "utf-8") if isinstance(col["value"], str) else unicode(col["value"])
if len(col["value"]) > limit:
col["value"] = col["value"][0:limit] + "..."
except AttributeError: