ant build utf-8

使用Ant编译过程中,报error: unmappable character for encoding UTF8

最简单的方法是在Build.xml文件中,在所有出现Javac的地方,增加一个选项:encoding=”ISO-8859-1″,例如:

1
2
3
<javac srcdir="${build.src}" destdir="${build.classes}" encoding="ISO-8859-1">
  <classpath refid="classpath.library" />
</javac>

... 源文件,选择字符集“UTF-8″记得是UTF-8,而非“utf-8 bom”。点击批量保存按钮。再运行你的ant脚本,此时编译就不会报出“非法字符:/65279 ...

posted on 2016-08-19 14:36  szllq2000  阅读(619)  评论(0编辑  收藏  举报