Encoding problem in Alert Body

540 views
Skip to first unread message

Gyenesge

unread,
Aug 25, 2011, 9:27:30 AM8/25/11
to Java client for Apple Push Notification service (APNs)
First of all thank you for the library. It really useful.
Currently I'm trying to use it in an application that will be
available with Hungarian localization. App is now being tested in the
sandbox. When I'm sending texts with Hungarian special characters
(e.g. "esemény"), this appears on the iPhone as "esem\U00E9ny". Do you
have any idea, what is going wrong? Can I set encoding somewhere?

Thanks in advance, Gabor

Mahmood Ali

unread,
Dec 13, 2011, 8:04:57 PM12/13/11
to java-apn...@googlegroups.com
Greetings Gabor,

Sorry for taking so long to get to this email. Are you still having
issues with this?

The problem seems to be a string encoding mis-match between the
encoding at the provider (a.k.a. server) and the iPhone. The APNS
library uses UTF-8 for encoding the messages. Apparently, if the
pushed alert doesn't use 'loc-key' and 'loc-args', the iPhone would
use the iPhone user-set locale which might be using a different
encoding than UTF-8. Check [1]. So far, this my hypothesis and would
like to do more testing before changing the library.

I think there are two ways to go forward:
1. [Recommended] Use loc-key and loc-args and pre-defined the messages
in the application bundle, as recommended by the linked article.
2. Add an encoding parameter in the library to determine how the alert
should be encoded.

Regards,
Mahmood

[1] http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW3

It seems the issue here is that the library ser
Sorry for taking so long to get to this email.

Are you still having issues with this?

I just pushed a unit test case for ensuring that the strings are
encoded as UTF-8. I suspect that

Reply all
Reply to author
Forward
0 new messages