mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Unicode conversion would fail if the data was a string encoded with utf-8.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user