(props) Properties.storeToXML/loadFromXML should only require UTF-8 and UTF-16 to be supported

XMLWordPrintable

    • b63
    • Verified

      XML parsers are only required to support UTF-8 and UTF-16, see:

      http://www.w3.org/TR/REC-xml/#charencoding

      Unfortunately the Properties.storeToXML and loadFromXML methods do not specify how unsupported encodings should be handled. This creates a problem for alternative implementations that may not support all encodings.

      At this time (verified with jdk6, jdk7 and jdk8-b58) the behavior is:

      loadFromXML throws UnsupportedEncodingException

      storeToXML prints a warnings to System.err and silently stores the document in UTF-8.

            Assignee:
            Alan Bateman
            Reporter:
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: