Decode strings to unicode before slicing (bug 1277)
Simplified fix; based on a patch by Justin Forest. (merged from the gPodder 2.x branch)
This commit is contained in:
parent
e846a37555
commit
65cb840771
|
@ -340,6 +340,9 @@ class PodcastEpisode(PodcastModelObject):
|
|||
if not desc:
|
||||
return _('No description available')
|
||||
else:
|
||||
# Decode the description to avoid gPodder bug 1277
|
||||
if isinstance(desc, str):
|
||||
desc = desc.decode('utf-8', 'ignore')
|
||||
if len(desc) > MAX_LINE_LENGTH:
|
||||
return desc[:MAX_LINE_LENGTH] + '...'
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue