This method of the Document class sets the character set. This is an alias for the getEncoding method and exists only for compatibility reasons.
public final void setCharset(String encoding);