Closed dcelasun closed 10 years ago
I think this probrem caused by wrong $length
of payload.
It used mb_strlen but it returns UTF-8 char count, so it should use strlen for byte length.
We need JSON_UNESCAPED_UNICODE, because it being able to send more message.
strlen('çşiğüı') = 11 strlen('\u00e7Ÿi\u011f\u00fc\u0131') = 26
I think this probrem caused by wrong
$length
of payload.
Yep, looks like it.
We need JSON_UNESCAPED_UNICODE, because it being able to send more message.
How so? Do you have any examples?
How so? Do you have any examples?
Because payload can contain 256bytes. Not characters.
Payload
variable length, less than or equal to 256 bytes
I see. So, changing mb_strlen
to strlen
should be enough?
Probably. But I want to hear the opinions of other people.
+1 fix with strlen
Yes; this is indeed so that we can send longer messages when it is supported. I can update the unit test at some point here soon so that we can get this merged in. My apologies as I ahve been inactive for the last month.
@mwillbanks It's been 4 months, so any updates on this?
In Message.php line 303 the existence of
JSON_UNESCAPED_UNICODE
results in messages not being delivered to the device if the payload contains diacritics.I've used the message
çşiğüı
as payload and removingJSON_UNESCAPED_UNICODE
bit seems to fix the problem.This is probably not the ideal fix as I didn't investigate any further after removing that part.