Fix text encode for cyrillic
This commit is contained in:
parent
118d65cbd8
commit
c12b136b76
|
@ -268,7 +268,7 @@ class Session(YowsupApp):
|
||||||
self.logger.debug('received TextMessage' +
|
self.logger.debug('received TextMessage' +
|
||||||
' '.join(map(str, [
|
' '.join(map(str, [
|
||||||
_id, _from, to, notify, timestamp,
|
_id, _from, to, notify, timestamp,
|
||||||
participant, offline, retry, body
|
participant, offline, retry, body.encode("utf-8")
|
||||||
]))
|
]))
|
||||||
)
|
)
|
||||||
buddy = _from.split('@')[0]
|
buddy = _from.split('@')[0]
|
||||||
|
|
2
utils.py
2
utils.py
|
@ -43,7 +43,7 @@ def ago(secs):
|
||||||
return "%d %s ago" % (diff, period)
|
return "%d %s ago" % (diff, period)
|
||||||
|
|
||||||
def softToUni(message):
|
def softToUni(message):
|
||||||
message = message.decode("utf-8")
|
message = message.encode("utf-8")
|
||||||
return e4u.translate(message, reverse=False, **e4u.SOFTBANK_TRANSLATE_PROFILE)
|
return e4u.translate(message, reverse=False, **e4u.SOFTBANK_TRANSLATE_PROFILE)
|
||||||
|
|
||||||
def decodePassword(password):
|
def decodePassword(password):
|
||||||
|
|
Loading…
Reference in a new issue