Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #350 from Hoaas/testing

Fix issue #347.
  • Loading branch information...
commit 14cad125af54f451299d8072b6f53538c859ee8c 2 parents febd90f + 3579701
@ProgVal ProgVal authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 plugins/Web/plugin.py
View
8 plugins/Web/plugin.py
@@ -97,13 +97,13 @@ def titleSnarfer(self, irc, msg, match):
return
parser = Title()
try:
- parser.feed(text)
+ parser.feed(text.decode('utf-8'))
except HTMLParser.HTMLParseError:
self.log.debug('Encountered a problem parsing %u. Title may '
'already be set, though', url)
if parser.title:
domain = utils.web.getDomain(url)
- title = utils.web.htmlToText(parser.title.strip())
+ title = utils.web.htmlToText(parser.title.strip().encode('utf-8'))
s = format(_('Title: %s (at %s)'), title, domain)
irc.reply(s, prefixNick=False)
titleSnarfer = urlSnarfer(titleSnarfer)
@@ -178,12 +178,12 @@ def title(self, irc, msg, args, url):
text = utils.web.getUrl(url, size=size)
parser = Title()
try:
- parser.feed(text)
+ parser.feed(text.decode('utf-8'))
except HTMLParser.HTMLParseError:
self.log.debug('Encountered a problem parsing %u. Title may '
'already be set, though', url)
if parser.title:
- irc.reply(utils.web.htmlToText(parser.title.strip()))
+ irc.reply(utils.web.htmlToText(parser.title.strip().encode('utf-8')))
elif len(text) < size:
irc.reply(_('That URL appears to have no HTML title.'))
else:
Please sign in to comment.
Something went wrong with that request. Please try again.