Putting double quotes in JSON strings

I don’t know if any interpretation of that JSON in any programming language can give you that JSON as valid, but the format would not be correct.

All property names and all strings in JSON files must be enclosed in double quotes.. Thus, you could not enclose strings in single quotes as in your example.

The correct way would be to escape the double quotes within the string, with the backslash character “”. You use the double quotes to enclose the string value, and you escape the double quotes within the string.

{ “description”: “This is the value and I have something \”in quotes\” using double quotes” }

Actually in JSON you are using the same escape character for double quotes that is used in the Javascript language, so it will probably sound familiar to you.

See also  CSS 3. New font features. ligatures
Loading Facebook Comments ...
Loading Disqus Comments ...