Details
-
Enhancement
-
Resolution: Fixed
-
P3
-
12
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8217038 | 11 | Raymond Gallardo | P3 | Resolved | Fixed |
Description
Background:
After one customer upgraded from 5u17, garbled text occurred on their application where "UNICODE" was used.
Then they found it was caused by the fix ofJDK-6292322.
The behavior of String#getBytes("UNICODE") was changed by the fix.
before: return UTF-16 of Litle Endian with BOM
after : return UTF-16 of Big Endian with BOM
This is an enhancement request that requires Sustaining resolution.
Exception is not raised when an invalid name "UNICODE" is used in
java.lang.String#getBytes. However, "UNICODE" is not supported
according to the page below:
http://docs.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html
The test case Test.java
class Test{
public static void main(String[] args) throws
java.io.UnsupportedEncodingException{
System.out.println("Hello".getBytes("UNICODE"));
}
}
To reproduce:
1. jdk8u25/bin/javac Test.java
2. jdk8u25/bin/java Test
Suggested Fix:
Does strict check on API unsupported parameters
Make noticeable announcement if incompatibility change is made
After one customer upgraded from 5u17, garbled text occurred on their application where "UNICODE" was used.
Then they found it was caused by the fix of
The behavior of String#getBytes("UNICODE") was changed by the fix.
before: return UTF-16 of Litle Endian with BOM
after : return UTF-16 of Big Endian with BOM
This is an enhancement request that requires Sustaining resolution.
Exception is not raised when an invalid name "UNICODE" is used in
java.lang.String#getBytes. However, "UNICODE" is not supported
according to the page below:
http://docs.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html
The test case Test.java
class Test{
public static void main(String[] args) throws
java.io.UnsupportedEncodingException{
System.out.println("Hello".getBytes("UNICODE"));
}
}
To reproduce:
1. jdk8u25/bin/javac Test.java
2. jdk8u25/bin/java Test
Suggested Fix:
Does strict check on API unsupported parameters
Make noticeable announcement if incompatibility change is made
Attachments
Issue Links
- backported by
-
JDK-8217038 Highlight Charset aliases in encoding docs
-
- Resolved
-
- relates to
-
JDK-6292322 unexpected exception occurs in InputStreamReader for UTF-16, little endian, and Byte-order-mark
-
- Resolved
-
-
JDK-8066866 Supported Encodings page for Java SE 8 is out of date
-
- Resolved
-