summaryrefslogtreecommitdiff
path: root/omegle.py
diff options
context:
space:
mode:
authoryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2009-06-10 21:15:33 +0000
committeryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2009-06-10 21:15:33 +0000
commit8f3af268d4091fd6488a23480cbfdd9351046f42 (patch)
treeabfbfa2fceb5996ad7821267b58966b27b007ea3 /omegle.py
parent13f7059823f35130dda74cfbe88e47ee9894e937 (diff)
downloadomegle-8f3af268d4091fd6488a23480cbfdd9351046f42.tar.gz
omegle-8f3af268d4091fd6488a23480cbfdd9351046f42.zip
iblah
git-svn-id: http://xapek.org/svn/common/omegle@1107 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd
Diffstat (limited to 'omegle.py')
-rw-r--r--omegle.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/omegle.py b/omegle.py
index 2713636..8aac69e 100644
--- a/omegle.py
+++ b/omegle.py
@@ -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")