Skip to content

Commit

Permalink
Decode the output of ADB to support non-ascii characters
Browse files Browse the repository at this point in the history
  • Loading branch information
zjx20 committed Jun 27, 2015
1 parent d19b88a commit 228445d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions adbview.py
Expand Up @@ -53,9 +53,12 @@ def get_settings():
}
def decode(ind):
try:
return ind.decode(sys.getdefaultencoding())
return ind.decode("utf-8")
except:
return ind
try:
return ind.decode(sys.getdefaultencoding())
except:
return ind

def get_setting(key, view=None, raw=False):
def myret(key, value):
Expand Down Expand Up @@ -325,6 +328,7 @@ def __update(self):
try:
while True:
cmd, data = self.__queue.get_nowait()
data = decode(data)
if cmd == ADBView.LINE:
if not self.__loading and self.__doScroll:
snapPoint = self.__view.size()
Expand Down

0 comments on commit 228445d

Please sign in to comment.