1

I have a problem with the Cyrillic alphabet in the message, the server is written in php, the output is the following string of 285 characters.

string(285) "{"aps":{"alert":"\u041f\u0440\u043e \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 Redis \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0445\u043e\u0440\u043e\u0448\u0430\u044f","badge":0,"sound":"default","id":"100","category":"nat"}}"

When I write it on the English I get a string 180 characters. Because this message is not sent to the server Apple, since the size of the format. I do not know where the correct message.

user2759544
  • 181
  • 1
  • 10

1 Answers1

0

i found solution json_encode($payload, JSON_UNESCAPED_UNICODE);

user2759544
  • 181
  • 1
  • 10
  • This flag will definitely make your JSON look nicer, but strictly speaking you don't need it. A JSON parser will convert those escapes back to the original cyrillic characters. – roeland Nov 09 '15 at 21:12