JDK-8000685 : (props) Properties.storeToXML/loadFromXML should only require UTF-8 and UTF-16 to be supported
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-10-10
  • Updated: 2017-05-17
  • Resolved: 2012-10-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b63Fixed
Related Reports
Relates :  
Relates :  
Relates :  
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.