[json-lib-user] How to escape curly braces in JSON
Brought to you by:
aalmiray
From: Arash A. <ara...@re...> - 2007-11-07 15:32:49
|
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 |