like
JSON.parse('{"text": "~#"}');
will give synatax error, because there is 0x0B between ~ and #. you can’t see it, but it does exists.
How to avoid that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you can’t get the data encoded on the server, then one way is to pre-process it into JSON before attempting a decode. You might for example, apply a RegExp like so:
Obviosly, you want to follow the spec really closely when crafting the RegExp.