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