code: public static String quote(String s) {
          StringBuilder buf = new StringBuilder();
          for (int i = 0; i < s.length(); i++) {
              buf.append(quote(s.charAt(i)));
          }
          return buf.toString();
      }
docs: Escapes each character in a string that has an escape sequence or
  is non-printable ASCII.  Leaves non-ASCII characters alone.