ParseJSON and GenerateJSON for Classic/API 2.0

I like the way the new framework JSON handling works, but with that being deprecated I thought it would be handy to have something that parses to and generates from a Dictionary or Variant array… so I did it. It’s roughly as fast (maybe a bit faster) than JSONItem_MTC even though it’s independent, and many times faster than JSONItem or even the new framework stuff on non-Mac systems. ParseJSON_MTC is as tolerant as it can be of badly-formed or non-compliant JSON, and GenerateJSON_MTC includes a “pretty print” option.

It’s in the develop branch of my JSONItem_MTC project, soon to be merged into the release. If you want to bang on it to see if I’ve missed anything, that would be a great help.

https://github.com/ktekinay/jsonitem_mtc/tree/develop

I should mention that, unlike JSONItem but like JSONItem_MTC and the new framework, it properly parses UTF-16 surrogate pairs within strings and encodes all control characters when generating JSON. Also, ParseJSON_MTC will return a JSONDictionary, which is just a case-sensitive Dictionary subclass.