Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8000685

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

    XMLWordPrintable

Details

    • b63
    • Verified

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: