Re: [json-lib-user] How to escape curly braces in JSON
Brought to you by:
aalmiray
From: Andres A. <aal...@ya...> - 2007-11-07 20:46:41
|
Hmm it should work the same way as having "{'prop':'[something]'}" If it doesn't then it is a bug, I'll review it tonight and let you know my findings. Cheers, Andres ----- Original Message ---- From: Yuen Chi Lian <yue...@gm...> To: Arash Amiri <ara...@re...> Cc: jso...@li... Sent: Wednesday, November 7, 2007 12:11:35 PM Subject: Re: [json-lib-user] How to escape curly braces in JSON Hi Arashi, Have you tried using backslash, e.g. '\{'? That should work. On Nov 7, 2007 11:32 PM, Arash Amiri <ara...@re...> wrote: > Hi > I have a (I guess simple) question: > > I have a JSONString in Java such as > > String jsonString = "{ 'fields': [ > {name: 'Firstname{{}}',value: '{{{Tom}}}',attributes: [],}, > {name: 'Lastname',value: 'Meier',attributes: [],}, > {name: 'Knows',value: 'Frec',attributes: [{ name: 'Since', value: > '2000' }],}, > {name: 'Knows',value: 'Kim',attributes: [{ name: 'Since', value: > '2003' }],}, > {name: 'Knows',value: 'Mark',attributes: [{ name: 'Since', value: > '2002' }, > { name: 'From', value: 'Reports' }]} > ]}" > > When I use JSONObject jsonForm = new JSONObject(jsonString); > > I get an Exception: > > net.sf.json.JSONException: Expected a ':' after a key at character 7 > of {{{Tom}}} > > I dont get this. The braces are inside quotes, there should not be a > problem, or??? > > please help > greetings, arash > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > json-lib-user mailing list > jso...@li... > https://lists.sourceforge.net/lists/listinfo/json-lib-user > -- Cheers, Yuen-Chi Lian "I do not seek; I find." - Pablo Picasso ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ json-lib-user mailing list jso...@li... https://lists.sourceforge.net/lists/listinfo/json-lib-user __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |