Ant 非法字符: \65279,指定环境变量

众所周知,在跨程序的工程中,统一编码是至关重要的,而目前最普遍的则是统一采用“utf8”编码方案。 
但是在采用utf8方案的时候,请注意编辑器的自作聪明。 
比如editplus。 
原因就在于某些编辑器会往utf8文件中添加utf8标记(editplus称其为签名),它会在文件开始的地方插入三个不可见的字符(0xEF 0xBB 0xBF,即BOM),它的表示的是 Unicode 标记(BOM)。 
因此要解决这个问题的关键就是把这个标记选项去掉。 

首先用editplus打开这个文件,从Doucument菜单中选择Permanet Settings,有三个分类,分别是General,File, Tools.点击File,右边会有一项是 UTF-8 signature: 选择 always remove signature. 点击OK 

中文版本的 editplus 下操作的菜单结构如下: 文档->参数设置->文件->UTF-8签名->总是移除签名->确定 

这样就设置了UTF-8格式不需要在文件前面加标记。 
最后把文件另存为utf-8格式就好了.

 

<!-- 指定环境变量参数为:SystemVariable -->
<property environment="SystemVariable" />
<!-- 将tomcat.home指向环境变量TOMCAT_HOME指向的路径 -->
<property name="tomcat.home" value="${SystemVariable.TOMCAT_HOME}" />
<target name="display">
<echo message="${tomcat.home}" />
<mkdir dir="${tomcat.home}/test"/>
</target>

 

REFERENCES:http://www.oschina.net/question/86678_11815

http://www.cnblogs.com/xwdreamer/archive/2011/11/21/2296929.html

posted @ 2012-12-14 17:00  Atlas's blog  阅读(368)  评论(0编辑  收藏  举报