public static boolean isAscii(String s){
  if (s == null) {
    return true;
  }
  try {
    if (!s.equals(new String(s.getBytes(ASCII_CHARSET),ASCII_CHARSET))) {
      return false;
    }
  }
 catch (  java.io.UnsupportedEncodingException uee) {
    return false;
  }
  return true;
}

public static boolean isAscii ( String s ) { if ( s == null ) { return true ; } try { if ( ! s . equals ( new String ( s . getBytes ( ASCII_CHARSET ) , ASCII_CHARSET ) ) ) { return false ; } } catch ( java . io . UnsupportedEncodingException uee ) { return false ; } return true ; }
checks whether the string is ascii or not
