Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding problem #5

Open
joco73 opened this issue Jan 28, 2012 · 1 comment
Open

Encoding problem #5

joco73 opened this issue Jan 28, 2012 · 1 comment

Comments

@joco73
Copy link

joco73 commented Jan 28, 2012

Hi,

Great package.

When we have languages that use f.ex. åäö we can't have ascii encoding, we then need UTF8, on your blog a comment has a solution that works for us (see below), but would be great to have this in the package - as a config. parameter or something else.

On line 296 in ‘PushNotification.cs’ file, I have modified your code as follows..

// String length
byte[] apnMessageLength = BitConverter.GetBytes((Int16)Encoding.UTF8.GetBytes(apnMessage).Length);

and on line 305 was modified as

// Write the message
memoryStream.Write(Encoding.UTF8.GetBytes(apnMessage), 0, Encoding.UTF8.GetBytes(apnMessage).Length);

/Jonathan

@soundtina
Copy link

@joco73 yeah it's helpful. Now i can send Chinese to my phone. That's cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants