code: private void escape(String value) {
          int n = value.length();
          int i = 0;
          for (int j = 0; j < n; ++j) {
              char c = value.charAt(j);
              int k = ESCAPED_CHARS.indexOf(c);
              if (k >= 0 || c < ' ') {
                  if (i < j) {
                      append(value, i, j);
                  }
                  if (k >= 0) {
                      append(ESCAPE_SEQ[k]);
                  } else {
                      append("\\u");
                      append(String.format("%04x", Integer.valueOf(c)));
                  }
                  i = j + 1;
              }
          }
          if (i < n) {
              append(value, i, n);
          }
      }
docs: Output escaped value.
  
  @param value