Bug 122506 - [hovering] javadoc hover shows a broken string from DBCS javadoc html files.
Summary: [hovering] javadoc hover shows a broken string from DBCS javadoc html files.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-03 07:58 EST by Ryuichiro Isobe CLA
Modified: 2006-02-15 10:55 EST (History)
1 user (show)

See Also:


Attachments
javadoc hover (52.76 KB, image/x-png)
2006-01-03 08:00 EST, Ryuichiro Isobe CLA
no flags Details
original javadoc html file. (45.47 KB, image/x-png)
2006-01-03 08:02 EST, Ryuichiro Isobe CLA
no flags Details
Proposed fix (15.79 KB, patch)
2006-01-03 13:42 EST, Olivier Thomann CLA
no flags Details | Diff
Patch for regression tests (9.59 KB, patch)
2006-01-03 13:43 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryuichiro Isobe CLA 2006-01-03 07:58:46 EST
In Eclipse 3.2M4.

When javadoc hover is showed and javadoc information is created 
from DBCS javadoc html file, hover displays a broken DBCS string.
Comment 1 Ryuichiro Isobe CLA 2006-01-03 08:00:41 EST
Created attachment 32403 [details]
javadoc hover
Comment 2 Ryuichiro Isobe CLA 2006-01-03 08:02:50 EST
Created attachment 32404 [details]
original javadoc html file.
Comment 3 Dani Megert CLA 2006-01-03 08:30:12 EST
- is the contents in the Javadoc view wrong as well?
- what's the encoding of your Java project(s)?
- what's the encoding of your workspace?
Comment 4 Ryuichiro Isobe CLA 2006-01-03 09:07:42 EST
(In reply to comment #3)
> - is the contents in the Javadoc view wrong as well?

yes.

> - what's the encoding of your Java project(s)?

default encoding(MS932).

> - what's the encoding of your workspace?

default encoding(MS932),
and the encoding of javadoc html file is euc-jp.

When my workspace's encoding is euc-jp, javadoc hover(view) works fine.
Comment 5 Dani Megert CLA 2006-01-03 10:14:10 EST
Per default we should use the URLConnection's encoding.

IJavaElement.getAttachedJavadoc(...) Javadoc should be updated accordingly i.e. the encoding argument might be dropped.
Comment 6 Olivier Thomann CLA 2006-01-03 12:14:02 EST
What I could read in the html source code of the String page is that the encoding is "iso-2022-jp" and not "euc-jp".
I am trying to get a way to retrieve this encoding from the url connection.
Comment 7 Ryuichiro Isobe CLA 2006-01-03 12:59:13 EST
Sorry, the attached image was wrong.

The correct URL is http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/lang/String.html
This page is written by euc-jp.
Comment 8 Olivier Thomann CLA 2006-01-03 13:41:15 EST
If the url connection's content encoding is not specified, we should use the encoding specified in the html source if any. If none, then the project's encoding might be a good guess.
Comment 9 Olivier Thomann CLA 2006-01-03 13:42:41 EST
Created attachment 32422 [details]
Proposed fix
Comment 10 Olivier Thomann CLA 2006-01-03 13:43:03 EST
Created attachment 32423 [details]
Patch for regression tests
Comment 11 Olivier Thomann CLA 2006-01-03 13:44:35 EST
I will release in HEAD to give you a chance to try the next nightly build.
Please confirm then that it works as expected. I could get a different display here, but since I don't read Japanese, I cannot confirm that it works fine.
Comment 12 Olivier Thomann CLA 2006-01-03 14:47:07 EST
Fixed and released in HEAD.
Please reopen if you can still reproduce it with the next nightly build.
Comment 13 Olivier Thomann CLA 2006-01-03 14:47:16 EST
Fixed.
Comment 14 Ryuichiro Isobe CLA 2006-01-03 15:04:07 EST
thanks for fix.
I import JDT/Core project from HEAD, and try it.
it looks like problems were fixed.
Comment 15 Maxime Daniel CLA 2006-02-15 10:55:27 EST
Verified for 3.2 M5 using build I20060215-0010.
(Trusting comment #14 entered by the reporter).