From 3a181b6dd2731e6107a16ccd144054f6fdda6ad7 Mon Sep 17 00:00:00 2001 From: Daniel Folkinshteyn Date: Mon, 26 Jul 2010 09:22:07 -0400 Subject: [PATCH] Google: fix encoding bug in lucky --snippet; need to pass encoded string to utils.web.htmlToText --- plugins/Google/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Google/plugin.py b/plugins/Google/plugin.py index 9754649d0..56aea4cf9 100644 --- a/plugins/Google/plugin.py +++ b/plugins/Google/plugin.py @@ -168,14 +168,14 @@ class Google(callbacks.PluginRegexp): opts = dict(opts) data = self.search(text, msg.args[0], {'smallsearch': True}) if data['responseData']['results']: - url = data['responseData']['results'][0]['unescapedUrl'] + url = data['responseData']['results'][0]['unescapedUrl'].encode('utf-8') if opts.has_key('snippet'): - snippet = data['responseData']['results'][0]['content'] + snippet = data['responseData']['results'][0]['content'].encode('utf-8') snippet = " | " + utils.web.htmlToText(snippet, tagReplace='') else: snippet = "" result = url + snippet - irc.reply(result.encode('utf-8')) + irc.reply(result) else: irc.reply('Google found nothing.') lucky = wrap(lucky, [getopts({'snippet':'',}), 'text'])