mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +01:00
Web: Fix title snarfer with titles containing unicode characters.
This commit is contained in:
parent
841dc719e1
commit
a95546316f
@ -29,6 +29,7 @@
|
|||||||
###
|
###
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import HTMLParser
|
import HTMLParser
|
||||||
import htmlentitydefs
|
import htmlentitydefs
|
||||||
|
|
||||||
@ -105,6 +106,8 @@ class Web(callbacks.PluginRegexp):
|
|||||||
if parser.title:
|
if parser.title:
|
||||||
domain = utils.web.getDomain(url)
|
domain = utils.web.getDomain(url)
|
||||||
title = utils.web.htmlToText(parser.title.strip())
|
title = utils.web.htmlToText(parser.title.strip())
|
||||||
|
if sys.version_info[0] < 3:
|
||||||
|
title = title.encode('utf8', errors='replace')
|
||||||
s = format(_('Title: %s (at %s)'), title, domain)
|
s = format(_('Title: %s (at %s)'), title, domain)
|
||||||
irc.reply(s, prefixNick=False)
|
irc.reply(s, prefixNick=False)
|
||||||
titleSnarfer = urlSnarfer(titleSnarfer)
|
titleSnarfer = urlSnarfer(titleSnarfer)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user