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

Rationalize doclet -docencoding and -charset options

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 10
    • 9
    • tools
    • None

      The standard doclet provides two options and two internal settings for what ought to be a single concept.

      -docencoding is defined to be the actual encoding used to write an output file.
      See BaseConfiguration line 201, 491,
      See StandardDocFileFactory line 208

      -charset is defined to be the declared charset written into an HTML META tag.
      See HtmlConfiguration line 147, 547
      See uses of "charset" in HtmlDocWriter, HtmlDocletWriter, IndexRedirectWriter

      The actual value for the charset written into HTML files should directly correspond to the docencoding. It is wrong to allow them to be specified independently and differently.

      I suggest the following:
      * keep docencoding option and variable
      * keep charset option for compatibility, but ensure it is not set differently from docencoding. (This raises minor design issues of, what if only one is specified; that needs discussion)
      * ensure that in HTML files, we always write a META tag for Charset, but the value should be the name of the docencoding being used.
      * ensure that the default file encoding, if no options are specified , is UTF-8.

      Proposed test cases:
      No options given: output file should in be UTF-8, and should contain meta tag for charset for UTF-8
      One option given: output should be in specified format ... ISO-8859-1 is a good alternative to UTF-8
      Two options given with same value: : output should be in specified format ... ISO-8859-1 is a good alternative to UTF-8
      Two options given with different values: error

            pmuthuswamy Priya Lakshmi Muthuswamy (Inactive)
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: