json icon indicating copy to clipboard operation
json copied to clipboard

ParseAnonymousValue issue

Open yangruihan opened this issue 6 years ago • 2 comments

I cannot understand that str.Replace("\\", string.Empty); at 283 line in JSONParser.cs

When I try to parse {"abc": "he\rllo"},I got {"abc": "herllo"}

yangruihan avatar May 06 '19 12:05 yangruihan

Same issue .. I guess I remove that line and see if I encounter any issues. @yangruihan have you done this already, was it working for you?

topeterk avatar Aug 10 '19 20:08 topeterk

Ok this fix seems to work for me: Replace "anonymous string parsing" with function that does "known string parsing". Before: { string str = json.Substring(1, json.Length - 2); return str.Replace("\\", string.Empty); } after: { return ParseValue(typeof(string), json); }

topeterk avatar Aug 10 '19 20:08 topeterk