FoxInCloud has a FOSS function doing that, provided you remove the ‘\’ escape characters:
o = uValueJS(Strtran('{\"code\":\" ERROR\",\"message\":\"Message \",\"errors\":[{\"field1\":\"FIELD\",\"value\":\"VALUE\"}]}', '\"', '"')) https://github.com/FoxInCloud/FoxInCloud-AB <https://github.com/FoxInCloud/FoxInCloud-AB> Thierry Nivelet FoxinCloud Give your VFP app a new life in the cloud http://foxincloud.com/ > Le 16 nov. 2018 à 12:49, Paul Newton <paul.new...@pegasus.co.uk> a écrit : > > Hi all > > This is on Craig Boyd's Sweet Potato Software site > (https://tinyurl.com/ybk97s97) but the download link is coming up 404. Any > ideas where I can get hold of it? > Or alternative VFP options to handle JSON? I have tried the following from > various sources (e.g. VFPX, GitHub, CodePlex) : > nfJson-master (Marco Plaza), vfpJson-master (Ignacio Gutiérrez Torrero), > qdfoxjson (Victor Espina) > > but none of them can decode JSON strings like this: > > "{\"code\":\" ERROR\",\"message\":\"Message > \",\"errors\":[{\"field1\":\"FIELD\",\"value\":\"VALUE\"}]}" > > They all appear to stumble because of the additional JSON between the [] > brackets. I could StrExtract the string between the [] and decode that > separately but I would rather find something that can handle this directly. > Failing that I'll have to "roll my own". > > Thanks > > Paul Newton > [excessive quoting removed by server] _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/02dd95f0-95df-4b04-8705-088474e61...@foxincloud.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.