United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4463408 : javadoc tool: -encoding option is ignored for reading package.html

Details
Type:
Bug
Submit Date:
2001-05-25
Status:
Resolved
Updated Date:
2014-05-05
Project Name:
JDK
Resolved Date:
2001-07-13
Component:
tools
OS:
generic
Sub-Component:
javadoc(tool)
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.3.0
Fixed Versions:
1.4.0 (beta2)

Related Reports

Sub Tasks

Description

Name: bsC130419			Date: 05/25/2001


java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)


When -encoding option is specified to javadoc, Java source codes are converted
correctly, but package.html aren't.

For example, an open-source project manage java source codes and related
documents includes "package.html" in Shift-JIS and share them from various
environments (e.g. Japanese Solaris which character encoding is Japanese-EUC).
On solaris, package.html is converted to '???' sequences.

This is a simple javadoc's bug.

j2sdk1_3_0-src-sol/src/share/classes/com/sun/tools/javadoc/DocImpl.java has the
following method which reads "package.html":

    String readHTMLDocumentation(java.io.InputStream input, String filename)
throws java.io.IOException {
        int filesize = input.available();
        byte[] filecontents = new byte[filesize];
        input.read(filecontents, 0, filesize);
        input.close();
        String rawDoc = new String(filecontents);

In fact, "new String(filecontents)" is the same as "new String(filecontents,
..., ..., ByteToCharConverter.getDefault())". Therefore, package.html always is
converted from platform's native character encoding, not character encoding
specified by -encoding option.

  To fix this bug, add an encoding argument to it like "new String(filecontents,
encoding)"; it is saved in an Env object and acquired by getCharacterEncoding().
(Review ID: 124196) 
======================================================================

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
merlin-beta2

FIXED IN:
merlin-beta2

INTEGRATED IN:
merlin-beta2


                                     
2004-06-14
WORK AROUND



Name: bsC130419			Date: 05/25/2001


Before runing javadoc, package.html must be converted to your platform's native
character encoding.
======================================================================
                                     
2004-06-11
EVALUATION

Will investigate and fix asap.
jamie.ho@Eng 2001-05-25

This bug has been fixed.  Location of fix:
DocEnv.java
DocImpl.java
JavadocTool.java
Start.java

jamie.ho@Eng 2001-07-10
                                     
2001-05-25
PUBLIC COMMENTS

Will investigate and fix asap.
jamie.ho@Eng 2001-05-25

This bug has been fixed.  If specified, the encoding is now used to read
package.html.
jamie.ho@Eng 2001-07-10
                                     
2001-05-25



Hardware and Software, Engineered to Work Together