mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 04:32:36 +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)
|
||||
return
|
||||
try:
|
||||
text = text.decode('utf8', 'replace')
|
||||
text = text.decode(utils.web.get_encoding(text) or 'utf8',
|
||||
'replace')
|
||||
except:
|
||||
pass
|
||||
parser = Title()
|
||||
@ -217,7 +218,8 @@ class Web(callbacks.PluginRegexp):
|
||||
size = conf.supybot.protocols.http.peekSize()
|
||||
text = utils.web.getUrl(url, size=size)
|
||||
try:
|
||||
text = text.decode('utf8', 'replace')
|
||||
text = text.decode(utils.web.get_encoding(text) or 'utf8',
|
||||
'replace')
|
||||
except:
|
||||
pass
|
||||
parser = Title()
|
||||
|
Loading…
Reference in New Issue
Block a user