summaryrefslogtreecommitdiff
path: root/sunshine
diff options
context:
space:
mode:
authorKrzysztof Klinikowski <kkszysiu@gmail.com>2010-03-29 17:14:49 +0200
committerKrzysztof Klinikowski <kkszysiu@gmail.com>2010-03-29 17:14:49 +0200
commite273c87fff4bc547f09d28ced6dfe4ba0fbf5057 (patch)
treece1f0efb040229b343072756e7491db7eefa452f /sunshine
parent7295793671319f4f24f39c4dc7bc82984e65a14f (diff)
Another fixes in old plain messages. I forgot that's using win-1250 encoding.
Diffstat (limited to 'sunshine')
-rw-r--r--sunshine/connection.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sunshine/connection.py b/sunshine/connection.py
index 955257f..e3b07ad 100644
--- a/sunshine/connection.py
+++ b/sunshine/connection.py
@@ -622,9 +622,9 @@ class SunshineConnection(telepathy.server.Connection,
#we need to strip all html tags
text = stripHTML(msg.content.html_message).replace('&lt;', '<').replace('&gt;', '>')
else:
- text = msg.content.plain_message
+ text = (msg.content.plain_message).decode('windows-1250')
- message = "%s" % unicode(str(text).replace('\x00', '').replace('\r', ''))
+ message = "%s" % unicode(str(text).replace('\x00', '').replace('\r', '').decode('UTF-8'))
#print 'message: ', message
channel.Received(self._recv_id, timestamp, ahandle, type, 0, message)
self._recv_id += 1
@@ -656,7 +656,8 @@ class SunshineConnection(telepathy.server.Connection,
#we need to strip all html tags
text = stripHTML(msg.content.html_message).replace('&lt;', '<').replace('&gt;', '>')
else:
- text = msg.content.plain_message
+ text = (msg.content.plain_message).decode('windows-1250')
+
message = "%s" % unicode(str(text).replace('\x00', '').replace('\r', ''))
#message = "%s" % unicode(str(msg.content.plain_message).replace('\x00', '').replace('\r', '').decode('windows-1250').encode('utf-8'))