fix a lack of encoding bug in a place where it's probably been lingering for a while.

This commit is contained in:
Brian S. Stephan 2010-10-27 23:16:07 -05:00
parent 898a4aa6c0
commit eeb8ff83bf
1 changed files with 4 additions and 1 deletions

View File

@ -52,7 +52,10 @@ class DrBotServerConnection(irclib.ServerConnection):
splitpos = text.rfind(' ', 0, splitspace)
splittext = text[0:splitpos] + ' ' + splitter
text = splitter + ' ' + text[splitpos+1:]
self.send_raw("PRIVMSG %s :%s" % (target, unicode(splittext).encode('utf-8')))
try:
splittext = unicode(splittext).encode('utf-8')
except UnicodeDecodeError: pass
self.send_raw("PRIVMSG %s :%s" % (target, splittext))
times = times + 1
if times >= 4: