From a00f04e1d8dc3bbb86131b7c78e8abca685cc015 Mon Sep 17 00:00:00 2001 From: idealx Date: Fri, 18 Apr 2014 01:37:56 +0800 Subject: [PATCH] Update push.py Push payload add unicode support. --- push.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/push.py b/push.py index 807b9fb..1449e2b 100755 --- a/push.py +++ b/push.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- import struct from binascii import a2b_hex @@ -39,7 +40,7 @@ print >>sys.stderr, 'Missing cert file %s' % PUSH_CERT sys.exit(1) -payload = '{"aps":{"alert":"Broadcasting direct to apple with p12"}}' +payload = '{"aps":{"alert":"Broadcasting direct to apple with p12, 中文"}}' fmt = '!BH32sH%ds' % len(payload) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)