mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Google: Fix encoding with Python 3.
This commit is contained in:
parent
cca03ba06b
commit
df62ddad78
@ -29,6 +29,7 @@
|
|||||||
###
|
###
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import cgi
|
import cgi
|
||||||
import time
|
import time
|
||||||
import socket
|
import socket
|
||||||
@ -130,7 +131,9 @@ class Google(callbacks.PluginRegexp):
|
|||||||
for result in data:
|
for result in data:
|
||||||
title = utils.web.htmlToText(result['titleNoFormatting']\
|
title = utils.web.htmlToText(result['titleNoFormatting']\
|
||||||
.encode('utf-8'))
|
.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 title:
|
||||||
if bold:
|
if bold:
|
||||||
title = ircutils.bold(title)
|
title = ircutils.bold(title)
|
||||||
|
Loading…
Reference in New Issue
Block a user