I am trying to generate Java documentation in Eclipse. The source files are UTF-8 encoded and contain some umlauts. The resulting HTML files do not specify an encoding and do not use HTML entities, so the umlauts aren't displayed correctly in any browser.
What can I do to change this?
See the -charset, -encoding and -docencoding flags for the javadoc command.
-encoding
specifies the input encoding
-docencoding
specifies the output encoding
-charset
makes javadoc include a meta tag with encoding info
Modified from Eclipse javadoc in utf-8:
Project -> Generate Javadoc -> Next -> on the last page, in Extra Javadoc options write:
-encoding UTF-8 -charset UTF-8 -docencoding UTF-8
If you generate your javadoc with an ant task and you use UTF-8 you can do:
<javadoc encoding="UTF-8" charset="UTF-8" docencoding="UTF-8" sourcepath="yoursources" destdir="yourdocdir" />
When generating the javadoc with Gradle add the following to your build.gradle file:
javadoc {
options.encoding = 'UTF-8'
options.docEncoding = 'UTF-8'
options.charSet = 'UTF-8'
}