Skip to content

Commit

Permalink
Decode strings to unicode before slicing (bug 1277)
Browse files Browse the repository at this point in the history
Simplified fix; based on a patch by Justin Forest.
  • Loading branch information
thp committed Feb 28, 2011
1 parent 4ec0697 commit 472570b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gpodder/model.py
Expand Up @@ -929,6 +929,9 @@ def one_line_description(self):
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:
Expand Down

0 comments on commit 472570b

Please sign in to comment.