diff options
Diffstat (limited to 'omegle.py')
-rw-r--r-- | omegle.py | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -125,9 +125,15 @@ class OmegleChat(RESTClient): """ #if a raw string given, assume its utf8 if msg.__class__ == str: - msg = msg.decode("utf8") + try: + msg = msg.decode("utf8") + except UnicodeDecodeError: + pass #convert utf8 to RAW-utf8 - msg = msg.encode("utf8") + try: + msg = msg.encode("utf8") + except UnicodeEncodeError,e: + self.logger.critical(e) if not self.is_confirmed: self.logger.error("Cant send message if not is_confirmed") |