-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
None
The java.util.logging.Handler class has a setEncoding(String encoding) method. Methods that use an encoding string (elsewhere known as a charset name) throw UnsupportedEncodingException, which is a checked exception and is inconvenient for callers. Most of the APIs in the JDK have overloads or alternatives that take a Charset instead of a charset name, avoiding the need to declare a checked exception, and allowing the use of pre-declared Charsets in the StandardCharsets class.
An alternative method (setCharset?) should be added to set the charset of a Handler.
There is also a getEncoding() method that returns the encoding string; for symmetry it might also be useful to add something like getCharset() that returns the Charset used by this Handler.
An alternative method (setCharset?) should be added to set the charset of a Handler.
There is also a getEncoding() method that returns the encoding string; for symmetry it might also be useful to add something like getCharset() that returns the Charset used by this Handler.