argon/node-apn — pull request #86 by mmaelzer (2013-03-08 22:26:30+00:00)
Title: Fix for Notification.trim() and multibyte chars.

I noticed that after calling .trim() on a notification, I'd occasionally still see an 'invalidPayloadSize' error. After digging into the node-apn source a bit, I noticed that this was caused by assuming single byte chars in a string when trimming. For example, it would fail to trim enough hindi chars in an alert since it was using .substring() with a byte length. I added a small method to the Notification class to remove chars until the string actually meets the desired byte size.