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

(cs spec) Charset{De,En}Coder.charset() spec should be relaxed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Subcomponent:
    • CPU:
      generic
    • OS:
      solaris_9

      Description

      The java.nio.charset.Charset-X-Coder (Encoder, Decoder) API specifications
      should be relaxed to no longer put a restriction such as for CharsetEncoder
      that newDecoder().charset() ought to return an instnace of the original Charset
      object used to create the CharsetEncoder instance (and analogously for
      CharsetDecoder, with newEncoder().charset()).

      An example case in point where this restriction is inappropriate is for the
      case where an implementation provides a Charset which supplies a single decoder
      which can handle decoding of more than one encoding scheme. eg, ISO-2022-CN
      J2SE decoder will decode *both* ISO-2022-CN-CN or ISO-2022-CN-GB. Whereas for
      encoding to either of these separate (but related) encoding schemes is provided
      by means of a pair of exclusive Charsets.

      It would be better if the specification was relaxed to allow the returned
      charset instance provided by the charset() method to provide *either* an
      instance of the originating Charset instance *or* an instance of a Charset
      whose X-coder instances has the capability of performing roundtrip conversion.

      ###@###.### 2003-11-06

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ilittlesunw Ian Little (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: