Handler.setEncoding should have Charset overload

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: core-libs
    • 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.

            Assignee:
            Daniel Fuchs
            Reporter:
            Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: