if(str == null)
return "null";
StringBuffer sb = new StringBuffer();
sb.append('"');
CharacterIterator it = new StringCharacterIterator(str);
for (char c = it.first(); c != CharacterIterator.DONE; c = it.next()) {
if (c == '"') sb.append("\\\"");
else if (c == '\\') sb.append("\\\\");
else if (c == '\b') sb.append("\\b");
else if (c == '\f') sb.append("\\f");
else if (c == '\n') sb.append("\\n");