Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

JavaDoc package.html in UTF-8

Thread view: 
tony - 05 Jan 2008 15:16 GMT
NetBeans 6.0 does not show unicode symbols right for package.html, I
need to know is it my problem or not.
How to write package.html in UTF-8? Do I need insert special tags,
encodings? My file is saved as "UTF-8 without Signature".

Thanks in advance.
Zig - 05 Jan 2008 22:49 GMT
> NetBeans 6.0 does not show unicode symbols right for package.html, I
> need to know is it my problem or not.
> How to write package.html in UTF-8? Do I need insert special tags,
> encodings? My file is saved as "UTF-8 without Signature".
>
> Thanks in advance.

The encoding for a HTML document is specified by the Content-Type header  
from the HTTP server. When your file is not being served by a HTTP server,  
there are still some ways to get the browser / parser to detect the  
encoding, but those approaches tend to be flakey.

Your best bet is to use HTML entities instead. See:  
http://www.w3schools.com/tags/ref_symbols.asp
Thus, your special characters should appear as &#nnnn; in your document  
(unless they have a well-known entity name such as & which you may use  
instead).

HTH,

-Zig
Mark Space - 05 Jan 2008 23:33 GMT
> NetBeans 6.0 does not show unicode symbols right for package.html, I
> need to know is it my problem or not.
> How to write package.html in UTF-8? Do I need insert special tags,
> encodings? My file is saved as "UTF-8 without Signature".
>
> Thanks in advance.

First, how the heck are you getting UTF-8 into your doc files?  The
javadoc tool uses your platform encoding by default.

Second: try adding the -charset option to the javadoc command line.
This sets the <META> tag in your html output. It might clue your browser
what charset is being used.  Then, it might not.

-charset  name
    Specifies the HTML character set for this document. The name should
be a preferred MIME name as given in the IANA Registry. For example:

      C:> javadoc -charset "iso-8859-1" mypackage

    would insert the following line in the head of every generated page:

       <META http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">

I assume that "UTF-8" would work here as well as "iso-8859-1"

Try reading the reference for yourself, that's what I did.  I've never
used any of these options before:

<http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#charset>
tony - 07 Jan 2008 06:24 GMT
Hmm...
Seems that NetBeans does not know what encoding to use when showing
package.html in JavaDoc panel:

"Проверка русских букв. "

instead of

"Проверка русского текста."


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.