static void Main(string[] args)
{
var newLineChar = Char.Parse("\u2028");
var jsonStr = @"{""value"":""some chars " + newLineChar + @"""}";
var jObject = Newtonsoft.Json.Linq.JObject.Parse(jsonStr);
var jsonStrAfterParse = jObject.ToString(Newtonsoft.Json.Formatting.None);
}
I have a JSON string like:
"{\"value\":\"some chars \u2028\"}"
After I try to parse it using Newtonsoft.Json, I got the JSON:
"{\"value\":\"some chars \\u2028\"}"
The Line Separator char '\u2028' was parsed to '\\u2028'. I cannot make sure whether any other chars have the same issue. Can anyone help with this? Thanks.