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();
}

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 ( ) ; }
escapes each character in a string that has an escape sequence or is non - printable ascii . leaves non - ascii characters alone .
