My favorites
▼
|
Sign in
pyicqt
ICQ transport for XMPP
Project Home
Downloads
Wiki
Issues
Source
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
74
attachment: pyicqcyr.patch
(3.7 KB)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
diff -Naur src/legacy/icqt.py src2/legacy/icqt.py
--- src/legacy/icqt.py 2007-03-30 11:34:44.000000000 +0300
+++ src2/legacy/icqt.py 2007-07-10 11:03:06.000000000 +0300
@@ -176,7 +176,6 @@
if user.caps:
self.oscarcon.legacyList.setCapabilities(user.name, user.caps)
- status = status.encode("utf-8", "replace")
if user.flags.count("away"):
self.getAway(user.name).addCallback(self.sendAwayPresence, user)
else:
@@ -306,11 +305,12 @@
else:
show = 'away'
- status = oscar.dehtml(msg[1]) # Removes any HTML tags
+ #status = oscar.dehtml(msg[1]) # Removes any HTML tags
+ status = msg[1]
url = user.url
if status != None:
- charset = "iso-8859-1"
+ charset = config.encoding
m = None
if msg[0]:
m = re.search('charset="(.+)"', msg[0])
@@ -327,7 +327,14 @@
status = msg[0] + ": " + status
status = status.decode(charset, 'replace')
- LogEvent(INFO, self.session.jabberID, "Away (%s, %s) message %s" % (charset, msg[0], status))
+ if charset == 'utf-16be':
+ status = status.encode(config.encoding, 'replace')
+ status = oscar.dehtml(status) # Removes any HTML tags
+ try:
+ LogEvent(INFO, self.session.jabberID, "Away (%s, %s) message %s" % (charset, msg[0], status))
+ except:
+ LogEvent(INFO, self.session.jabberID, "Away broken (%s, s) message s" % (charset))
+ pass
if status == "Away" or status=="I am currently away from the computer." or status=="I am away from my computer right now.":
status = ""
diff -Naur src/tlib/oscar.py src2/tlib/oscar.py
--- src/tlib/oscar.py 2007-06-18 16:49:35.000000000 +0300
+++ src2/tlib/oscar.py 2007-06-19 12:52:18.000000000 +0300
@@ -19,6 +19,7 @@
from scheduler import Scheduler
+import config
import struct
import md5
import string
@@ -199,7 +200,7 @@
# in the docutils extension module
# see http://docutils.sourceforge.net
# modified for better use here
-def guess_encoding(data, defaultencoding='iso-8859-1'):
+def guess_encoding(data, defaultencoding=config.encoding):
"""
Given a byte string, attempt to decode it.
Tries 'utf-16be, 'utf-8' and 'iso-8859-1' (or something else) encodings.
@@ -870,7 +871,7 @@
self.connectPort = 5190
# Note that this is "no unicode" default encoding
# We use unicode if it's there
- self.defaultEncoding = 'iso-8859-1'
+ self.defaultEncoding = config.encoding
if not self.capabilities:
self.capabilities = [CAP_CHAT]
@@ -2022,14 +2023,14 @@
charSet = 0x0000
except:
try:
- part[0] = part[0].encode('iso-8859-1')
+ part[0] = part[0].encode(config.encoding)
charSet = 0x0003
except:
try:
part[0] = part[0].encode('utf-16be', 'replace')
charSet = 0x0002
except:
- part[0] = part[0].encode('iso-8859-1', 'replace')
+ part[0] = part[0].encode(config.encoding, 'replace')
charSet = 0x0003
if 'macintosh' in part[1:]:
charSubSet = 0x000b
@@ -2042,7 +2043,7 @@
# We'll investigate this in more detail later.
features = '\x01\x01\x02'
# Why do i need to encode this? I shouldn't .. it's data.
- data = data.encode('iso-8859-1', 'replace') + TLV(2, TLV(0x0501, features)+messageData)
+ data = data.encode(config.encoding, 'replace') + TLV(2, TLV(0x0501, features)+messageData)
if wantAck:
log.msg("sendMessage: Sending wanting ACK")
data = data + TLV(3)
Powered by
Google Project Hosting