工程编码格式转换

由于GWT(Google Web Toolkit)需要utf-8编码的源代码(采用gbk会乱码),因此决定将所有的java文件encoding改为utf-8.

转换方法:ant

build.xml
Java代码
<project name="encoding" default="build">  
    <target name="build">      
      <copy todir="e:/output" outputencoding="utf-8">  
        <fileset dir=".">  
          <include name="**/*.java"/>  
        </fileset>  
      </copy>  
    </target>  
</project> 

<project name="encoding" default="build">
    <target name="build">   
      <copy todir="e:/output" outputencoding="utf-8">
        <fileset dir=".">
          <include name="**/*.java"/>
        </fileset>
      </copy>
    </target>
</project>



先把源代码全部用utf-8格式拷贝到e:/output,然后再把output中的所有文件拷贝到原先的地方就可以.

Eclipse的菜单 Windows\Preferences\Workspace\Text file encoding 改成 utf-8

猜你喜欢

转载自5211422.iteye.com/blog/838660
今日推荐