I am trying to sync messages of android device to server using Java script object notation, i am able to sync all of the columns e.g. address, date, status, read, type except message body, it gives Java script object notation syntax error. i have gone through many links, they are saying that there are some sort of characters/hidden characters, i tried their solutions but doesn't helped at all, i tried some of these: json_decode returns JSON_ERROR_SYNTAX but online formatter says the JSON is OK json_decode syntax error from valid json
Asked
Active
Viewed 130 times
-1
-
what exactly your problem is? – U.Swap Aug 01 '16 at 13:03
1 Answers
0
I am trying to encode android sms message body using JSON and send over the php webservice, but on php end it was not interpreted as JSON because of hidden chracters inside the string of message body. Adding this one line of code to replace hidden characters in string on Android end solves the problem, here's the solution: body.replaceAll("\p{C}", "?");

Adeeb Khalid Ch
- 1
- 4