summaryrefslogtreecommitdiffstats
path: root/modules/head.py
diff options
context:
space:
mode:
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']