Javadoc error: unmappable character for encoding ASCII

14,112

Solution 1

Specifying UTF-8 as your resource encoding is a good thing to do, but you may also perform the following:

If you generate your Javadoc using javadoc binary, you may check its -encoding parameter:

javadoc: 
usage: javadoc [options] [packagenames] [sourcefiles] [@files]
...
-encoding <name>          Source file encoding name

Using Eclipse, you may specify this option in field "Extra Javadoc options (...):" in last Wizard step (example: -encoding UTF-8).

Solution 2

I know it's old question, but maybe it would be helpful for someone. I want to add something to Xav's answer (I cannot add comments so I write answer):

Javadoc gives you following description (javadoc -help):

-encoding <name>    Source file encoding name
-charset <charset>  Charset for cross-platform viewing of generated documentation

"-encoding" parameter indicates how to read characters. You can also use "-charset" option to making your HTML documentation more readable.

Share:
14,112

Related videos on Youtube

Spoofy
Author by

Spoofy

Updated on June 05, 2022

Comments

  • Spoofy
    Spoofy almost 2 years

    Im trying to create a Javadoc but i can't.

    I have written my comments in swedish så they content charachters as å,ä,ö. This is giving me over 248 erros.

    Is there a way to change the encoding for the whole Project?

    I have tried:

    1. Right-clicked on the project
    2. Choosed Resource
    3. Change to UTF-8
    4. Restarted Eclipse
    5. Create new Javadoc

    This results in the following error:

    error: unmappable character for encoding ASCII

    Is there something else i can do to solve this problem?

  • user3076105
    user3076105 about 3 years
    I got the same error from the java compiler and found that javac -encoding utf-8 ... works in that case, too.