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

utf-8 and Internal error #167

Open
hibinyru opened this issue Mar 26, 2019 · 1 comment
Open

utf-8 and Internal error #167

hibinyru opened this issue Mar 26, 2019 · 1 comment

Comments

@hibinyru
Copy link

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)

@hibinyru
Copy link
Author

hibinyru commented Apr 4, 2019

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

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

1 participant