From da23e3e43d5eb17f737aa51c8269f6932a237010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=98=89=E4=BF=8A?= Date: Fri, 19 Apr 2013 08:15:10 +0800 Subject: [PATCH 1/2] Fix typo --- pyapns/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyapns/model.py b/pyapns/model.py index 3af9980..d7e471b 100644 --- a/pyapns/model.py +++ b/pyapns/model.py @@ -156,7 +156,7 @@ def remember_recent_notifications(self, notifications): if len(self.recent_notification_idents) >= self.recent_notifications_to_keep: removed_ident = self.recent_notification_idents.popleft() removed_note = self.recent_notifications.pop(removed_ident) - self.internal_idents.pop(removed_note.internal_ident) + self.internal_idents.pop(removed_note.internal_identifier) # create a new internal identifier and map the notification to it internal_ident = self.get_next_ident() From 548a231c20792244c6737379fd2c9bd05a6ebd28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=98=89=E4=BF=8A?= Date: Fri, 19 Apr 2013 08:16:03 +0800 Subject: [PATCH 2/2] Support languages other than English --- pyapns/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyapns/model.py b/pyapns/model.py index d7e471b..ce21f2b 100644 --- a/pyapns/model.py +++ b/pyapns/model.py @@ -232,7 +232,8 @@ def binaryify(t): 'token "{}" could not be decoded: {}'.format(str(t), str(e) )) - encoded_payload = json.dumps(self.payload, separators=(',', ':')) + encoded_payload = json.dumps(self.payload, separators=(',', ':'), + ensure_ascii=False).encode('utf-8') return structify(binaryify(self.token), self.internal_identifier, self.expiry, encoded_payload)