private String safe(String src){
  StringBuffer sb=new StringBuffer();
  for (int i=0; i < src.length(); i++) {
    char c=src.charAt(i);
    if (c >= 32 && c < 128) {
      sb.append(c);
    }
 else {
      sb.append("<" + (int)c + ">");
    }
  }
  return sb.toString();
}

private String safe ( String src ) { StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < src . length ( ) ; i ++ ) { char c = src . charAt ( i ) ; if ( c >= 32 && c < 128 ) { sb . append ( c ) ; } else { sb . append ( "<" + ( int ) c + ">" ) ; } } return sb . toString ( ) ; }
convert a string to one in which any non - printable bytes are replaced by " < # # # > " where # # is the value of the byte .
