Skip to content

Commit

Permalink
Adding lost quotes in json format (RC). Fixes issue 7018
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Mar 5, 2014
1 parent bfd3cce commit 1c07956
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,24 +207,18 @@ private String jsonKey(final String key) {
}

private Object json(String s) {
return escape(s);
}

// -------------- Copied from JSONValue -------------------
/**
* Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
* @param s
* @return
*/
private static String escape(String s){
if(s==null)
return null;
StringBuffer sb = new StringBuffer();
sb.append("\"");
escape(s, sb);
sb.append("\"");
return sb.toString();
}

// -------------- Copied from JSONValue -------------------
/**
* Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
* @param s - Must not be null.
* @param sb
*/
Expand Down

0 comments on commit 1c07956

Please sign in to comment.