mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-11 10:56:39 +00:00
Fix #1917 : UnicodeDecodeError with long torrent names
This commit is contained in:
parent
04b8949178
commit
9d16b50075
@ -84,7 +84,7 @@ def trim_string(string, w, have_dbls):
|
|||||||
if w <= 0:
|
if w <= 0:
|
||||||
return ""
|
return ""
|
||||||
elif w == 1:
|
elif w == 1:
|
||||||
return "…"
|
return u"…"
|
||||||
elif have_dbls:
|
elif have_dbls:
|
||||||
# have to do this the slow way
|
# have to do this the slow way
|
||||||
chrs = []
|
chrs = []
|
||||||
@ -100,9 +100,9 @@ def trim_string(string, w, have_dbls):
|
|||||||
if width != w:
|
if width != w:
|
||||||
chrs.pop()
|
chrs.pop()
|
||||||
chrs.append('.')
|
chrs.append('.')
|
||||||
return "%s… "%("".join(chrs))
|
return u"%s… "%("".join(chrs))
|
||||||
else:
|
else:
|
||||||
return "%s… "%(string[0:w-2])
|
return u"%s… "%(string[0:w-2])
|
||||||
|
|
||||||
def format_column(col, lim):
|
def format_column(col, lim):
|
||||||
dbls = 0
|
dbls = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user