[Otfbot-svn] r129 - trunk

allo at BerliOS allo
Fr Jun 29 14:05:59 CEST 2007


Author: allo
Date: 2007-06-29 14:05:58 +0200 (Fri, 29 Jun 2007)
New Revision: 129

Modified:
   trunk/otfbot.py
Log:
fix for encoding exception


Modified: trunk/otfbot.py
===================================================================
--- trunk/otfbot.py	2007-06-29 11:20:09 UTC (rev 128)
+++ trunk/otfbot.py	2007-06-29 12:05:58 UTC (rev 129)
@@ -447,7 +447,11 @@
 			@param msg: the message
 			@type msg: string
 		"""
-		if msg[0]==self.getConfig("commandChar", "!", "main"):
+		try:
+			char=msg[0].decode('UTF-8').encode('UTF-8')
+		except UnicodeDecodeError:
+			char=msg[0].decode('iso-8859-15').encode('UTF-8')
+		if char==self.getConfig("commandChar", "!", "main").encode("UTF-8"):
 			tmp=msg[1:].split(" ", 1)
 			command=tmp[0]
 			if len(tmp)==2:




Mehr Informationen über die Mailingliste Otfbot-dev