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

Highlight Charset aliases in encoding docs

    Details

      Backports

        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 of JDK-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

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  rgallard Raymond Gallardo
                  Reporter:
                  shadowbug Shadow Bug
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Due:
                    Created:
                    Updated:
                    Resolved: