Closed pilot34 closed 11 years ago
$nLen = mb_strlen($aMessage['BINARY_NOTIFICATION'], '8bit'); you can't use 8bit encoding for russian because you should send request in json and json require an utf-8.
and I have no troubles with russian (except length, of course), vietnam, chinese and other languages :)
you can't use 8bit encoding for russian because you should send request in json and json require an utf-8.
So, I'm using 8bit only to count right length of string in bytes. I don't change string, that is sending to server.
hm, you are correct, sorry.
but it's why Duccio are using simple strlen() -- it works only with 8bit encoding and it calculate bytes.
Yes, but on my server settings there was wrong length with strlen(), I have no idea why...
Here is a solution: https://github.com/duccio/ApnsPHP/issues/27
hshhhhh, thank you! I haven't found it
I had problem on one server with messages in push, when one symbol is more than one byte. There was error xxx bytes instead of yyy bytes. It was fixed with this patch.
It is very strange, I think on another server ApnsPHP was working without patches. Can it be because of default server encoding?
I'm obj-c developer, not good in php, so I'm not very sure, that my fix is good for all cases, but I think, that mb_strlen with '8bit' is better to right counting of length in bytes. Isn't it?