From ace4c19a9e97ff74a1ee1f221e417fa95601c2b1 Mon Sep 17 00:00:00 2001 From: wannaphongcom Date: Fri, 16 Oct 2015 13:10:03 +0700 Subject: [PATCH] fix bug --- fbchat/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fbchat/utils.py b/fbchat/utils.py index 561d8d1..868a2bb 100644 --- a/fbchat/utils.py +++ b/fbchat/utils.py @@ -15,7 +15,7 @@ def now(): return int(time()*1000) def get_json(text): - return json.loads(re.sub(r"for.*(;;).*;", '', text.decode("unicode-escape"), 1)) # have bug !!! AttributeError: 'str' object has no attribute 'decode' + return json.loads(re.sub(r"for.*(.*;.*;.*).*;", '', text.encode('utf-8').decode("unicode-escape"), 1)) def digit_to_char(digit): if digit < 10: @@ -34,4 +34,3 @@ def generateMessageID(client_id=None): k = now() l = int(random() * 4294967295) return ("<%s:%s-%s@mail.projektitan.com>" % (k, l, client_id)); -