Skip to content

Commit 7c14a3d

Browse files
dontenum
1 parent c7d2d91 commit 7c14a3d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

JSONObject.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ of this software and associated documentation files (the "Software"), to deal
9090
* </ul>
9191
*
9292
* @author JSON.org
93-
* @version 2012-07-02
93+
* @version 2012-10-26
9494
*/
9595
public class JSONObject {
9696

@@ -1216,8 +1216,10 @@ public static Writer quote(String string, Writer w) throws IOException {
12161216
default:
12171217
if (c < ' ' || (c >= '\u0080' && c < '\u00a0')
12181218
|| (c >= '\u2000' && c < '\u2100')) {
1219-
hhhh = "000" + Integer.toHexString(c);
1220-
w.write("\\u" + hhhh.substring(hhhh.length() - 4));
1219+
w.write("\\u");
1220+
hhhh = Integer.toHexString(c);
1221+
w.write("0000", 0, 4 - hhhh.length());
1222+
w.write(hhhh);
12211223
} else {
12221224
w.write(c);
12231225
}
@@ -1450,7 +1452,7 @@ public static Object wrap(Object object) {
14501452
object instanceof Short || object instanceof Integer ||
14511453
object instanceof Long || object instanceof Boolean ||
14521454
object instanceof Float || object instanceof Double ||
1453-
object instanceof String || object instanceof Enum) {
1455+
object instanceof String) {
14541456
return object;
14551457
}
14561458

0 commit comments

Comments
 (0)