# JsonUtility is throwing exception when there is \" in the string

The following is my JSON file:

{
"data" : [
{
"nameString" : "My name is \"Ansar\"",
"id" : 1234
}
]
}


When I try to parse this JSON file using JsonUtility, it is throwing an exception because of the \" character. If I remove the character from the string, it works smoothly.

Exception:

ArgumentException: JSON parse error: Missing a comma or '}' after an object member.
UnityEngine.JsonUtility.FromJson (System.String json, System.Type type) (at /Users/builduser/buildslave/unity/build/Modules/JSONSerialize/Public/JsonUtility.bindings.cs:50)


Why this is happening? Is this a JsonUtility bug? Anyways to fix this?

The "nameString" : "My name is \"Ansar\"" should be kept as "nameString" : "My name is \\\"Ansar\\\"". That is Backslash is replaced with \\ .