apnserver icon indicating copy to clipboard operation
apnserver copied to clipboard

UTF8 encoding issues

Open slemiere opened this issue 13 years ago • 0 comments

Hello,

I have run into issues when trying to send push notifications with utf8 character in it on ruby 1.9. With 2 changes on my fork I was able to send push with utf8 content:

  1. Use the JSON generate/parse methods instead of activesupport's as activesupport would encode the utf8 char as something like \ue002e and apple doesn't support that.
  2. Use bytesize instead of size when adding the length of the payload in the notification headers as size would not take in account the real length of the UTF8 encoded characters.

Is it something that was known and is there better solution to do it ? If not would you like me to pretty it up and make a pull request ?

Anyway thank you for the gem :)

Sylvain

slemiere avatar Oct 21 '11 15:10 slemiere