Fixing non-ascii support
authorEd Page <eopage@byu.net>
Mon, 8 Nov 2010 23:52:17 +0000 (17:52 -0600)
committerEd Page <eopage@byu.net>
Mon, 8 Nov 2010 23:52:17 +0000 (17:52 -0600)
src/channel/text.py
src/gvoice/backend.py
src/util/go_utils.py

index f4a9589..206299c 100644 (file)
@@ -72,7 +72,7 @@ class TextChannel(tp.ChannelTypeText):
                                {},
                        )
                except Exception:
-                       _moduleLogger.exception(result)
+                       _moduleLogger.exception("Oh no, what happened?")
                        return
 
                self._conn.session.textsStateMachine.reset_timers()
index 47b5fc3..d910f4b 100755 (executable)
@@ -87,7 +87,7 @@ class Message(object):
                return "%s (%s): %s" % (
                        self.whoFrom,
                        self.when,
-                       "".join(str(part) for part in self.body)
+                       "".join(unicode(part) for part in self.body)
                )
 
        def to_dict(self):
@@ -393,7 +393,7 @@ class GVoiceBackend(object):
                        self._sendSmsURL,
                        {
                                'phoneNumber': flattenedPhoneNumbers,
-                               'text': message
+                               'text': unicode(message).encode("utf-8"),
                        },
                )
                self._parse_with_validation(page)
index 46805ab..10b14e8 100644 (file)
@@ -183,7 +183,7 @@ class AsyncPool(object):
                                result = func(*args, **kwds)
                                isError = False
                        except Exception, e:
-                               _moduleLogger.error("Error, passing it back to the main thread")
+                               _moduleLogger.exception("Error, passing it back to the main thread")
                                result = e
                                isError = True
                        self.__workQueue.task_done()