I have to pass unicode string to a JSONObject.
JSONObject json = new JSONObject("{\"One\":\"\\ud83c\\udf45\\ud83c\\udf46\"}");
json.put("Two", "\ud83c\udf45\ud83c\udf46");
System.out.println(json.toString());
but I have this:
{"One":"","Two":""}
I want this:
{"One":"\ud83c\udf45\ud83c\udf46","Two":"\ud83c\udf45\ud83c\udf46"}
One way of doing this is:
This will print the string literal
\ud83c\udf45when you try to print the JSON.