summaryrefslogtreecommitdiffstats
path: root/modules/head.py
diff options
context:
space:
mode:
authorSean B. Palmer <http://inamidst.com/sbp/>2008-08-09 16:01:20 +0100
committerSean B. Palmer <http://inamidst.com/sbp/>2008-08-09 16:01:20 +0100
commit31d107c0bd7fa2e172b09cce9560f3a10c1091af (patch)
treeef635bf8efb3c9af1532f45bc98f7dbd841285a6 /modules/head.py
parent86c2f274d52d5991ac112af0063177d4c09fe945 (diff)
downloadbot-31d107c0bd7fa2e172b09cce9560f3a10c1091af.tar.gz
bot-31d107c0bd7fa2e172b09cce9560f3a10c1091af.tar.bz2
bot-31d107c0bd7fa2e172b09cce9560f3a10c1091af.zip
Minor fixes, full stop stripping of tell nicknames &c.
Diffstat (limited to 'modules/head.py')
-rwxr-xr-xmodules/head.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/head.py b/modules/head.py
index c271de1..4cb19e3 100755
--- a/modules/head.py
+++ b/modules/head.py
@@ -135,8 +135,12 @@ def f_title(self, origin, match, args):
return unichr(char).encode('utf-8')
title = r_entity.sub(e, title)
- if not title:
- title = '[Title is the empty document, "".]'
+ if title:
+ try: title.decode('iso-8859-1')
+ except: pass
+ else: title = title.decode('iso-8859-1').encode('utf-8')
+ else: title = '[The title is empty.]'
+
self.msg(origin.sender, origin.nick + ': ' + title)
else: self.msg(origin.sender, origin.nick + ': No title found')
f_title.commands = ['title']