LyricsTabs error with non unicode chars
Submitted by Leo Iannacone
Link to original bug (#693125)
Description
It happens sometime that if you have some char (in my case àèéìèòù) in lyric file LyricsTabs will not show your lyrics.
(09:18:06) [0x1b83b20] [LyricsView.lyrics_ready] /usr/lib/rhythmbox/plugins/context/LyricsTab.py:239: loading lyrics into webview Traceback (most recent call last): File "/usr/lib/rhythmbox/plugins/context/LyricsTab.py", line 133, in lyrics_ready stylesheet = self.styles) File "/usr/lib/python2.7/dist-packages/mako/template.py", line 412, in render return runtime.render(self, self.callable, args, data) File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 766, in _render **kwargs_for_callable(callable, data)) File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 798, in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 824, in exec_template callable(context, *args, **kwargs) File "/tmp/rb-contextFikt9R/usr/share/rhythmbox/plugins/context/tmpl/lyrics-tmpl.html.py", line 42, in render_body __M_writer(unicode(lyrics)) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 277: ordinal not in range(128)
I fixed it with the following patch.
What do you think about it?
A similar problem exist also if 'special chars' are also in the song title/author...