Re: [json-lib-user] Strings with square brackets being interpreted as arrays
Brought to you by:
aalmiray
From: Pedro P. <ped...@we...> - 2010-05-31 18:30:33
|
Thanks for the suggestion. Unfortunately, I need to import the whole JSON file, and then append it to another JSONObject, so cherry-picking the bits I care about (like what your solution seems to imply) is not a possibility. From what I can gather, the problem is with the tokenizer evaluating values and then not distinguishing between quoted strings and unquoted arrays in the value string. Going to try and figure out whether that's solvable in a moderately simple way. Regards, Pedro Pinheiro On May 31, 2010, at 6:38 PM, Christoffer Dam Bruun wrote: > Hi, > > I have had the exact same problem. > > I solved it by changing the following files: > > <snip> > > And then I only use putByRef and addByRef in my program. > > The key thing in the add/putByRef methods are that when you add/put a > String then you do *not* call the original put/add methods that try to > interpret the String. > > Best regards, > Christoffer Dam Bruun > > On 31-05-2010 18:09, Pedro Pinheiro wrote: >> Hello all, >> >> I'm having an issue with json-lib 2.2.3 and 2.3, where strings that >> contain exactly a json-style array are interpreted as arrays rather >> than strings ("key":"[1,2,3]" are being interpreted as if the source >> read "key": [1,2,3]). A space at the end of the string seems to >> short- >> circuit this behaviour (i.e. "key":"[1,2,3]" is misinterpreted, but >> "key":"[1,2,3] " isn't). This seems to be consistent (and I find the >> same behaviour) with what Pedro Alves posted about a year ago in >> this >> mailling list, where the same happens with strings shaped like >> "function(){}". Is this supposed to be a feature I'm unaware of, or >> is >> this simply a bizarre bug? Thanks for your attention. >> >> Regards, >> >> Pedro Pinheiro >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> json-lib-user mailing list >> jso...@li... >> https://lists.sourceforge.net/lists/listinfo/json-lib-user >> > > > ------------------------------------------------------------------------------ > > _______________________________________________ > json-lib-user mailing list > jso...@li... > https://lists.sourceforge.net/lists/listinfo/json-lib-user |