Google: Fix encoding issue.

This commit is contained in:
Valentin Lorentz 2013-05-13 14:18:22 +02:00
parent 8421300e14
commit 93ecc2424f

View File

@ -140,12 +140,15 @@ class Google(callbacks.PluginRegexp):
results.append(format('%s: %u', title, url)) results.append(format('%s: %u', title, url))
else: else:
results.append(url) results.append(url)
if sys.version_info[0] < 3:
repl = lambda x:x if isinstance(x, unicode) else unicode(x, 'utf8')
results = map(repl, results)
if not results: if not results:
return [format(_('No matches found.'))] return [_('No matches found.')]
elif onetoone: elif onetoone:
return results return results
else: else:
return [format('; '.join(results))] return [u'; '.join(results)]
@internationalizeDocstring @internationalizeDocstring
def lucky(self, irc, msg, args, opts, text): def lucky(self, irc, msg, args, opts, text):