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

javadoc for CharsetEncoder.maxBytesPerChar() should be made clearer

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P5
    • Resolution: Won't Fix
    • Affects Version/s: 9
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      Javadoc currently states:

      --------------------------------
      public final float CharsetEncoder.maxBytesPerChar()
      Returns the maximum number of bytes that will be produced for each character of input.
      This value may be used to compute the worst-case size of the output buffer required for a given input sequence.
      --------------------------------

      This may be misinterpreted, as it may be not clear what CHARACTERs this sentence is about.
      If they were Unicode code-points, UTF8Encoder.maxBytesPerChar() should return 4.0.
      However, as the statement is in fact about Java characters, it correctly returns 3.0.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              naoto Naoto Sato
              Reporter:
              igerasim Ivan Gerasimov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: