[totem] jamendo: Fix encoding problems with non-ASCII track names
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] jamendo: Fix encoding problems with non-ASCII track names
- Date: Wed, 30 Mar 2011 19:32:22 +0000 (UTC)
commit 87cdefd461dfe8d3bfa4055f78bdb514c31ccf09
Author: Philip Withnall <philip tecnocode co uk>
Date: Wed Mar 30 17:15:16 2011 +0100
jamendo: Fix encoding problems with non-ASCII track names
Ensure that track names are uniformly decoded as UTF-8, and never re-encoded
as ASCII. Attempting to re-encode them as ASCII was causing non-ASCII track
names to (obviously) blow things up.
Helps: bgo#646245
src/plugins/jamendo/jamendo.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/jamendo/jamendo.py b/src/plugins/jamendo/jamendo.py
index 5619cf3..6b7082f 100644
--- a/src/plugins/jamendo/jamendo.py
+++ b/src/plugins/jamendo/jamendo.py
@@ -287,7 +287,7 @@ class JamendoPlugin(gobject.GObject, Peas.Activatable, PeasGtk.Configurable):
# track title
# Translators: this is the title of a track in Python format
# (first argument is the track number, second is the track title)
- tt = ('<small>%s</small>' % _(u'%02d. %s')) % \
+ tt = (u'<small>%s</small>' % _(u'%02d. %s')) % \
(i+1, self._format_str(track['name']))
# track duration
td = self._format_duration(track['duration'])
@@ -603,7 +603,7 @@ class JamendoPlugin(gobject.GObject, Peas.Activatable, PeasGtk.Configurable):
if not st:
return ''
try:
- return escape(st.encode('utf8'))
+ return escape (unicode (st))
except:
return st
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]