ApnsPHP
ApnsPHP copied to clipboard
utf-8 and Internal error
Hello
after the translation of website to utf-8, push no longer sent Writes: Internal error (127 by written in instead of 105 bytes)
If I try to send in Latin, it sends 3 push (i received its push-messages) and writes its an error.
If I try to send a Cyrillic symbols at UTF-8, then I get an error and the push does not come.
If in the Push.php file I change the line $nLen = strlen ($aMessage ['BINARY_NOTIFICATION']); to $nLen = mb_strlen($aMessage ['BINARY_NOTIFICATION'], 'latin1'); push in Latin comes successfully and there are no errors
Cyrillic does not reach (but does not show errors)
$ nLen = mb_strlen construction ($ aMessage ['BINARY_NOTIFICATION'], 'utf-8'); Does not help. how to be?
(sorry fo my english)
use
if ((int) ini_get('mbstring.func_overload') & 2) {
$nLen = mb_strlen($aMessage['BINARY_NOTIFICATION'], '8bit');
} else {
$nLen = strlen($aMessage['BINARY_NOTIFICATION']);
}
if write '8bit' or 'latin1' - push in english symbols send succesfully and no error, BUT if use russian symbols - no error and push don't get
Help please