samiamim / apns-python-wrapper

Automatically exported from code.google.com/p/apns-python-wrapper
0 stars 0 forks source link

unicode problem #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
why are you always checking for str e.g. in an alert?
the alert of an APNSNotification does not accept unicode as you check for str 
or APNSAlert

(like everywhere else in the code)

did I miss something in the specs?

Original issue reported on code.google.com by henrik.genssen@gmail.com on 18 Apr 2010 at 12:00

GoogleCodeExporter commented 9 years ago
I assume you're right about support of unicode. But I need some example of your 
code to make patch

Original comment by klymys...@gmail.com on 18 Apr 2010 at 1:25

GoogleCodeExporter commented 9 years ago
Sorry, forget about this
I tried something like this in django:

message = APNSNotification()
message.alert(u'äüößÄÜÖ')

now I do:

message.alert(smart_str(u'äüößÄÜÖ'))

and erverything works fine...

Original comment by henrik.genssen@gmail.com on 18 Apr 2010 at 4:20

GoogleCodeExporter commented 9 years ago
Anyway you can make additional condition in notifications.py line 289: 
add:
if not isinstance(alert, str) and not isinstance(alert, unicode) and not 
isinstance(alert, APNSAlert):
instead of:
if not isinstance(alert, str) and not isinstance(alert, APNSAlert):

and at line 324:
if isinstance(self.alertObject, str) or isintance(self.alertObject, unicode):
instead of:
if isinstance(self.alertObject, str):

I'll fix it in upcoming version of wrapper

Original comment by klymys...@gmail.com on 18 Apr 2010 at 5:08

GoogleCodeExporter commented 9 years ago
This issue have been fixed in 0.5 version of APNSWrapper

Original comment by klymys...@gmail.com on 24 Apr 2010 at 9:36