Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSON Valid Chars

Tags:

json

Is the presence of a \' within double quotes "invalid" in the context of a JSON response? Is there a definitive JSON spec that could give me an answer?

like image 603
syker Avatar asked Jul 13 '10 04:07

syker


1 Answers

Check out http://www.json.org/ and scroll down to the "String" diagram.

You can see there how the \ is a "control" character. If you want a literal backslash within your JSON, you'll need to escape it: "\\" is a valid JSON string, for example.

like image 100
Josiah Avatar answered Oct 22 '22 11:10

Josiah