1

Closed

Malformed JSON when serializing a dictionary containing a key with a double-quote

description

The following code results in malformed JSON output:
Dictionary<string, object> dict = new Dictionary<string, object>();
dict["With \"Quotes\""] = "With \"Quotes\"";
fastJSON.JSONParameters p = new fastJSON.JSONParameters();
p.EnableAnonymousTypes = false;
p.SerializeNullValues = false;
p.UseExtensions = false;
Console.WriteLine(fastJSON.JSON.ToJSON(dict, p));
output:
{"With "Quotes"":"With \"Quotes\""}
Closed Jul 15, 2016 at 2:00 PM by MGholam
Fixed in 2.1.17

comments