Skip to content

Commit ad4c33e

Browse files
committed
Improved UTF-8 treatment in messages
- Version 4.4.2
1 parent 23961d0 commit ad4c33e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

AndroidViewClient/src/com/dtmilano/android/adb/adbclient.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@author: Diego Torres Milano
1818
'''
1919

20-
__version__ = '4.4.1'
20+
__version__ = '4.4.2'
2121

2222
import sys
2323
import warnings
@@ -128,7 +128,8 @@ def __send(self, msg, checkok=True, reconnect=False):
128128
self.__setTransport()
129129
else:
130130
self.checkConnected()
131-
self.socket.send('%04X%s' % (len(msg), msg))
131+
b = bytearray(msg, 'utf-8')
132+
self.socket.send('%04X%s' % (len(b), b))
132133
if checkok:
133134
self.__checkOk()
134135
if reconnect:
@@ -366,7 +367,7 @@ def drag(self, (x0, y0), (x1, y1), duration, steps):
366367
self.shell('input swipe %d %d %d %d %d' % (x0, y0, x1, y1, duration*1000))
367368

368369
def type(self, text):
369-
self.shell('input text "%s"' % text)
370+
self.shell(u'input text "%s"' % text)
370371

371372
def wake(self):
372373
self.shell('input keyevent 26')

0 commit comments

Comments
 (0)