the result looks strange when the string contains ASCII chars, chinese
char and SBC char:
public static void main(String[] args) throws Exception {
Map map = new HashMap();
map.put("MixedChars", "中文--jabsorb");
JSONObject json = new JSONObject(map);
String jsonStr = json.toString();
System.out.println(jsonStr);
}
run the code, the printed result string as:
{"MixedChars":"中文\u2014jabsorb"}
so i want to know how deserialize the json string in my client side,my
client side write in delphi.
On Jan 15, 4:45 pm, Russell Jones <
russell.jo...@careers.ox.ac.uk>
wrote:
> I get the following in firebug
>
> a="\u2014"
> b="--"
> a==b
> true
>
> So, AIUI, from the perspective of JSON, if not Java, the two are equivalent.
>
> NHSoft.YHW wrote:
> > Hi,
>
> > when I serialize SBC sting using jabsorb 1.3, it has strange problem.
>
> > test code:
>
> > public static void main(String[] args) throws Exception {
> > Map map = new HashMap();
> > map.put("SBC case", "--");
> > JSONObject json = new JSONObject(map);
> > String jsonStr = json.toString();
> > System.out.println(jsonStr);
> > }
>
> > but print string is {"SBC case":"\u2014"}, i think that the proper
> > result is {"SBC case":"--"}