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

(cs spec) charset package spec misleading - it does not describe how it relates to sun.io

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-libs
    • generic
    • generic



      Name: nt126004 Date: 09/04/2001


      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)


      There is a large degree of confusion between the new java.nio.charset
      package and the 'old' charset converters available via
      InputStreamReader, OutputStreamWriter and String

      According to the javadoc for java.nio.charset:

      http://java.sun.com/j2se/1.4/docs/api/java/nio/charset/package-summary.html

      'Most users will not use these classes directly; instead they will use the
      existing charset-related constructors and methods in the String class, together
      with the existing InputStreamReader and OutputStreamWriter classes, all of
      whose implementations have been reworked to make use of the charset facilities
      defined in this package'

      This appears to be not true. If one looks at the following bug report:

      http://developer.java.sun.com/developer/bugParade/bugs/4422049.html

      It seems that the 'old' charset converters have *not* been reworked to the
      new scheme, nor will they be until 'tiger' (whatever that is).

      If this bug indeed states the truth, then a substantial update is required
      to the javadoc to explain why the 'old' charsets cannot be enumerated using
      java.nio.charset.Charset.availableCharsets().

      I just spent substantial effort trying to determine why availableCharsets()
      would not return the charsets included in 'charsets.jar' in the jre/lib
      directory. The only answer to this appears to be in bug 4422049.

      This is particularly disappointing, since I have been hoping for a way
      to enumerate the available charsets, and it appears that I still can't.
      (Review ID: 131256)
      ======================================================================

            iris Iris Clark
            nthompsosunw Nathanael Thompson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: