issue 626 fixes unicode and truncattion, thanks mweissen

This commit is contained in:
Massimo Di Pierro
2012-01-20 11:36:42 -06:00
parent 1356e5b73f
commit 6837da0917
3 changed files with 16 additions and 14 deletions
+6
View File
@@ -124,6 +124,12 @@ def xmlescape(data, quote = True):
return data
def truncate_string(text, length, dots='...'):
text = text.decode('utf-8')
if len(text)>length:
text = text[:length-len(dots)].encode('utf-8')+dots
return text
def URL(
a=None,
c=None,