Skip to content

Commit

Permalink
Merge pull request #47 from JiajunYao/fix_typo
Browse files Browse the repository at this point in the history
Fix typo and support other languages
  • Loading branch information
Samuel Sutch committed Apr 19, 2013
2 parents b63ec75 + 548a231 commit ac49a22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyapns/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit ac49a22

Please sign in to comment.