Valid JSON string not working in Unity

When I’m sending in a JSON string from javascript to Unity I get the following warning in the debugger console on the page: Uncaught SyntaxError: Unexpected token ILLEGAL

The JSON I’m sending looks like this: {"purchase_info":"You can purchase the product by clicking the \"Purchase\"-button below."}

I tried debugging this in Unity and put the JSON as a string in a UnityScript file and immediately got the following error: unexpected char: ‘"’

It would seem that UnityScript doesn’t like strings that are correctly JSON encoded, but it seems ok if I double escape the double quote. Any comments on this? It seems a little silly to have to reformat the string into an invalid JSON before sending it to Unity.

Have a read at this i had the same problem
Click Here

I had problem which i googled and came here so I will post my answer here, maybe someone gonna use it.
I’m using localization system from unity’s tutorial. To read it I’m using code:

        LocalizationData loadedData = JsonUtility.FromJson<LocalizationData>(dataAsJson);

        for (int i = 0; i < loadedData.items.Length; i++)
        {
            localizedText.Add(loadedData.items_.key, loadedData.items*.value);*_

}
Yesterday I was working on rest of my text files and writing them into another language.
Properly line looks like that:

*{“key”:“Tutorial_012”,“value”:"So here you may upgrade basic stats.
You may see stats of your car before buy,
just use buttons to see how much will cost desired result.

Let’s increase TOP SPEED"},*
To set new line of text as you may see I’m using **
**. Problem which took me whole day to solve was just one mistake :slight_smile:

*{“key”:“Tutorial_012”,“value”:"So here you may upgrade basic stats.
You may see stats of your car before buy,n\just use buttons to see how much will cost desired result.

Let’s increase TOP SPEED"},*
On third line of my text I used 'n' where it must be
'

So just be carefull :slight_smile:
Cheers,
Kamil