charset and docencoding options
Could someone clarify the meaning of the documentation for -charset and -docencoding? The documentation for -docencoding states
"Specifies the encoding of the generated HTML files."
Does this mean that if I specify the following:
c:> javadoc -docencoding "EUC-JP" mypacakge
Javadoc will generate documents using the EUC-JP character set? Or, is the character encoding system dependent?
Likewise, does the -charset option have any effect on the character set used by the javadoc program, or is it simply a means of causing a meta tag with a charset attribute to be inserted into the generated pages.
[640 byte] By [
dcardera] at [2007-9-28 14:25:43]

Hopefully your questions is answered in this bug report,
whose content is copied below. We do need to document
these options better.
http://developer.java.sun.com/developer/bugParade/bugs/4756688.html
The standard doclet currently has two separate but related options:
-charset and -docencoding, which, if they both taken values, should
take the same value. The -docencoding option tells the standard doclet
whiThe standard doclet currently has two separate but related options:
-charset and -docencoding, which, if they both taken values, should
take the same value. The -docencoding option tells the standard doclet
which encoding to use when writing the HTML files. The -charset option
independently creates the following META tag which identifies the encoding
used when reading the HTML files:
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
To play things safe, the charset should really be derived from the
character encoding named in the -docencoding option (or the default used
if this option isn't given), in the manner described in my evaluation.
Letting the caller specify -charset and -docencoding separately just
opens the door to inconsistent settings. Can we remove the -charset
option? Or just provide an option to turn off the charset specification?
Evaluation:
To prevent them from being different, we could either:
- Deprecate -charset, automatically add this META tags and add -nocharset
option to turn it off
or
- Don't add this META tag automatically and change the meaning of -charset
to add the META tag (or create an option with a new name, such as
-insertcharset)
The second of these two options is more backward-compatible and seems less
likely to cause existing javadoc scripts to produce HTML pages that
cannot be read. The first conforms more to the HTML spec requiring
charset, and would force users to set -docencoding (or -nocharset)
if it gets set wrong automatically.
-Doug Kramer
Javadoc team