Google: Fix encoding with Python 3.

This commit is contained in:
Valentin Lorentz 2013-01-06 16:46:21 +01:00
parent cca03ba06b
commit df62ddad78

View File

@ -29,6 +29,7 @@
###
import re
import sys
import cgi
import time
import socket
@ -130,7 +131,9 @@ class Google(callbacks.PluginRegexp):
for result in data:
title = utils.web.htmlToText(result['titleNoFormatting']\
.encode('utf-8'))
url = result['unescapedUrl'].encode('utf-8')
url = result['unescapedUrl']
if sys.version_info[0] < 3:
url = url.encode('utf-8')
if title:
if bold:
title = ircutils.bold(title)