简体   繁体   English

Javadoc错误:编码ASCII的不可映射字符

[英]Javadoc error: unmappable character for encoding ASCII

Im trying to create a Javadoc but i can't. 我试图创建一个Javadoc但我不能。

I have written my comments in swedish så they content charachters as å,ä,ö. 我在瑞典写了我的评论,他们的内容是å,ä,ö。 This is giving me over 248 erros. 这给了我超过248个错误。

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 改为UTF-8
  4. Restarted Eclipse 重启Eclipse
  5. Create new Javadoc 创建新的Javadoc

This results in the following error: 这会导致以下错误:

error: unmappable character for encoding ASCII 错误:编码ASCII的不可映射字符

Is there something else i can do to solve this problem? 我还能做些什么来解决这个问题吗?

Specifying UTF-8 as your resource encoding is a good thing to do, but you may also perform the following: 指定UTF-8作为资源编码是一件好事,但您也可以执行以下操作:

If you generate your Javadoc using javadoc binary, you may check its -encoding parameter: 如果使用javadoc二进制文件生成Javadoc,则可以检查其-encoding参数:

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 ). 使用Eclipse ,您可以在上一个向导步骤中的“ Extra Javadoc options (...): ”字段中指定此选项(例如: -encoding UTF-8 )。

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): 我想在Xav的答案中添加一些东西(我不能添加评论,所以我写答案):

Javadoc gives you following description (javadoc -help): Javadoc为您提供以下描述(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. “-encoding”参数指示如何读取字符。 You can also use "-charset" option to making your HTML documentation more readable. 您还可以使用“-charset”选项使HTML文档更具可读性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM