This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 71979 - I18N: Javadoc name is garbled for JDK1.5 JA javadoc
Summary: I18N: Javadoc name is garbled for JDK1.5 JA javadoc
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Javadoc (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2006-01-29 09:48 UTC by Masaki Katakai
Modified: 2007-05-30 03:03 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
menu is garbled (31.96 KB, image/jpeg)
2006-01-29 11:36 UTC, Masaki Katakai
Details
English javadoc source and Japanese (116.25 KB, image/jpeg)
2006-01-31 11:50 UTC, Masaki Katakai
Details
example path : use jdocRegs.getDocEncoding() to get javadoc encoding before parsing title. (5.00 KB, patch)
2006-03-06 02:17 UTC, Masaki Katakai
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2006-01-29 09:48:45 UTC
I'm not sure this is related to
http://www.netbeans.org/issues/show_bug.cgi?id=71978,
but the title of Javadoc of JDK1.5 JA is garbled in menu "View"->"Documentation
Indices".

1. Download JDK1.5 JA javadoc
   from http://java.sun.com/j2se/1.5.0/download.jsp

2. Add the javadoc on Java Platform Manager

3. See View -> Documentation Indices menu

I tried this on Windows XP. When I tried English javadoc, it shows
"Java2 Platform SE 5.0".
Comment 1 Masaki Katakai 2006-01-29 11:36:45 UTC
Created attachment 28630 [details]
menu is garbled
Comment 2 Jan Pokorsky 2006-01-31 11:01:46 UTC
Sorry, I do not speak Japanese. What is wrong with the name? It is taken from
jar:file:///jdk-1_5_0-doc-ja.zip!/docs/ja/api/overview-frame.html.
Comment 3 Masaki Katakai 2006-01-31 11:50:45 UTC
Created attachment 28672 [details]
English javadoc source and Japanese
Comment 4 Masaki Katakai 2006-01-31 11:54:36 UTC
Thank you for the info. I checked the HTML file and I attached the
snapshot that shows correct Japanese, which is Japanese translation
of "Overview". 

"overview-frame.html" is using euc-jp as encoding but which encoding
is using in NetBeans to get the title?
Comment 5 Jan Pokorsky 2006-01-31 13:15:48 UTC
NetBeans are using a default charset of the Java virtual machine. See menu
Help/About and Detail/System locale. The javadoc module will have to look for
the encoding of each html file before parsing the title.
Comment 6 Masaki Katakai 2006-03-06 02:17:39 UTC
Created attachment 29126 [details]
example path : use jdocRegs.getDocEncoding() to get javadoc encoding before parsing title.
Comment 7 Jan Pokorsky 2006-04-20 10:49:27 UTC
fixed in /cvs/javadoc/src/org/netbeans/modules/javadoc/search/IndexBuilder.java
new revision: 1.13; previous revision: 1.12

Please verify if the Japanese is displayed properly. Do you think it is worthy
to merge this to the release55 branch?
Comment 8 Ken Frank 2006-04-20 17:26:35 UTC
When i add to platform mgr the ja javadoc zip, then create java project, console
msg says t cant open the zip - so i think that is why for me the view menu
for documentation is empty - are there other steps needed, like to unzip the
javadoc first ?

ken.frank@sun.com
Comment 9 Jan Pokorsky 2006-04-20 22:47:52 UTC
No, this is the proper way how to add javadoc. There has to be something wrong
with your zip file like insufficient access permissions or broken content. Any
exception in your var/log?
Comment 10 Ken Frank 2006-04-20 23:11:50 UTC
combination of inaccurate download and then not chmod +x the zip -
now the mbyte looks ok at least on solaris ja locale, as to in view menu and in
browser. 

We should wait for Masaki's feedback before its closed.

ken.frank@sun.com
Comment 11 Masaki Katakai 2006-04-24 05:59:16 UTC
Hi Jan,

Thank you very mush for working on it.

But it's not working for me.

It seems that there are two issues.

1. super(DTD.getDTD("html32"))

If I used "html32" as DTD, it seems that handleStartTag() is never called
for META tag. So "encoding" is always null. When I changed this to "html40",
it started working.

2. Reader r = new BufferedReader(new InputStreamReader(html.getInputStream()));

The Reader is using the native encoding. If encoding is not the same with
Javadoc, the title string (in handleTitle()) is corrupted at reading.

Is there any reason not using jdocRegs.getDocEncoding()? Getting encoding
and Getting title need to be separated. I think after getting encoding, Reader
needs to be opened with the encoding to get title.

Comment 12 Jan Pokorsky 2006-04-24 15:59:35 UTC
ad 1) super(DTD.getDTD("html32")) is correct since html32.bdtd exists in rt.jar.
For htm40 there is no such file. META tag is definitely part of HTML 3.2. See
http://www.w3.org/TR/REC-html32#meta.

BTW JavadocRegistry.getEncoding uses DTD.getDTD("html32") too.

ad 2) I know about default charset so there is
  title = new String(this.title.getBytes(), encoding);
  
  this should work for 8-bit encodings as euc-jp.
  
The reason for not using jdocRegs.getDocEncoding() is the performance. I do not
want to run 2 parsers. The menu has to be responsive. IMO it is a bug of
javax.swing.text.html.parser.Parser. It should take InputStream to parse the
file and decode according to specified charset.

I will try to write own simple parser.
Comment 13 Jan Pokorsky 2006-04-25 16:43:26 UTC
fixed in /cvs/javadoc/src/org/netbeans/modules/javadoc/search/IndexBuilder.java
new revision: 1.14; previous revision: 1.13

I have tested with charsets euc-jp(jdk1.5), iso-2022-jp(jdk1.4)
Comment 14 Tomas Zezula 2006-06-07 15:02:57 UTC
The patch seems good.
Comment 15 Max Sauer 2006-06-12 11:07:18 UTC
Verified in NB6.0(euc-jp). The patch is ok from qa side..

------
Product Version         = NetBeans IDE Dev (Build 200606111800)
Operating System        = Linux version 2.6.11.11 running on i386
Java; VM; Vendor; Home  = 1.5.0_06; Java HotSpot(TM) Client VM 1.5.0_06-b05; Sun
Microsystems Inc.; /usr/java/jdk1.5.0_06/jre
System Locale; Encoding = ja_JP (nb); EUC-JP-LINUX
Comment 16 Jan Pokorsky 2006-06-13 13:52:45 UTC
merged to release55

/cvs/javadoc/src/org/netbeans/modules/javadoc/search/IndexBuilder.java
new revision: 1.12.26.2; previous revision: 1.12
Comment 17 Ken Frank 2007-05-26 18:59:23 UTC
Max,

where is nb6 is the view->documentation indexes menu ?  I want to verify it.

ken.frank@sun.com
Comment 18 Max Sauer 2007-05-29 09:23:36 UTC
AFAIK we don't have this menu anymore. But the above metioned simple parser has
been added, so I guess we can close this issue.
Comment 19 Ken Frank 2007-05-29 15:15:38 UTC
Based on Max's comments, am verifying and closing  this since the menu is not
present anymore.

ken.frank@sun.com
Comment 20 Masaki Katakai 2007-05-30 03:03:56 UTC
From NetBeans 5.5 release, this menu has been moved to Help menu (Help > Javadoc
References).

I verified this works properly on NetBeans 6.0 200705291800 with both JDK1.5 and
JDK6 Japanese javadocs.