mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-25 19:44:13 +01:00
Web: Use utils.web.get_encoding for guessing charset.
This commit is contained in:
parent
d4df5de91d
commit
820113344c
@ -99,7 +99,8 @@ class Web(callbacks.PluginRegexp):
|
|||||||
irc.reply(url+" : "+utils.web.strError(e), prefixNick=False)
|
irc.reply(url+" : "+utils.web.strError(e), prefixNick=False)
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
text = text.decode('utf8', 'replace')
|
text = text.decode(utils.web.get_encoding(text) or 'utf8',
|
||||||
|
'replace')
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
parser = Title()
|
parser = Title()
|
||||||
@ -217,7 +218,8 @@ class Web(callbacks.PluginRegexp):
|
|||||||
size = conf.supybot.protocols.http.peekSize()
|
size = conf.supybot.protocols.http.peekSize()
|
||||||
text = utils.web.getUrl(url, size=size)
|
text = utils.web.getUrl(url, size=size)
|
||||||
try:
|
try:
|
||||||
text = text.decode('utf8', 'replace')
|
text = text.decode(utils.web.get_encoding(text) or 'utf8',
|
||||||
|
'replace')
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
parser = Title()
|
parser = Title()
|
||||||
|
Loading…
Reference in New Issue
Block a user