Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4463408
Votes 3
Synopsis javadoc tool: -encoding option is ignored for reading package.html
Category doclet:tbd
Reported Against 1.3
Release Fixed 1.4(merlin-beta2)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs
Submit Date 25-MAY-2001
Description




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  customer  and acquired by getCharacterEncoding().
(Review ID: 124196) 
======================================================================
Work Around




Before runing javadoc, package.html must be converted to your platform's native
character encoding.
======================================================================
Evaluation
Will investigate and fix asap.
  xxxxx@xxxxx   2001-05-25

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

  xxxxx@xxxxx   2001-07-10
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang