public static boolean isEncodingSupported(String encoding){
  if (encoding == null) {
    return false;
  }
  try {
    return Charset.isSupported(encoding);
  }
 catch (  IllegalCharsetNameException icne) {
    return false;
  }
}

public static boolean isEncodingSupported ( String encoding ) { if ( encoding == null ) { return false ; } try { return Charset . isSupported ( encoding ) ; } catch ( IllegalCharsetNameException icne ) { return false ; } }
determines whether this jre can both encode and decode text in the specified encoding .
