public static void checkEncoding ( String encoding ) throws IOException { try { URLEncoder . encode ( "" , encoding ) ; } catch ( UnsupportedEncodingException e ) { throw new IOException ( "invalid encoding [" + encoding + "]" ) ; } }
check if given encoding is ok