RSS: Fall back to decoding the headline with 'utf8' if 'ascii' failed.

This commit is contained in:
Valentin Lorentz 2013-07-31 09:33:03 +00:00
parent 53c7c9beaa
commit 33a236079f
1 changed files with 11 additions and 4 deletions

View File

@ -155,10 +155,17 @@ class RSS(callbacks.Plugin):
if self.registryValue(dateconfig, channel):
if headline[2]:
pubDate = ' [%s]' % (headline[2],)
newheadlines.append(format('%s %u%s',
headline[0],
link,
pubDate))
try:
newheadlines.append(format('%s %u%s',
headline[0],
link,
pubDate))
except UnicodeDecodeError:
newheadlines.append(format('%s %u%s',
headline[0].decode('utf8',
'replace'),
link,
pubDate))
return newheadlines
def _newHeadlines(self, irc, channels, name, url):