Skip to content

Instantly share code, notes, and snippets.

@fbaligand
Last active December 15, 2015 00:49
Show Gist options
  • Save fbaligand/5175961 to your computer and use it in GitHub Desktop.
Save fbaligand/5175961 to your computer and use it in GitHub Desktop.
Script ANT permettant de convertir l'encoding d'une arborescence de fichiers, de ISO-8859-1 vers UTF-8
<?xml version="1.0" encoding="UTF-8"?>
<project name="native2ascii" default="native2ascii" basedir=".">
<property name="srcEncoding" value="ISO-8859-1" />
<property name="destEncoding" value="UTF-8" />
<property name="srcDir" value="${basedir}/input" />
<property name="destDir" value="${basedir}/output" />
<property name="tempDir" value="${basedir}/temp" />
<property name="filesRegex" value="**/*.java" />
<target name="native2ascii">
<mkdir dir="${tempDir}"/>
<native2ascii encoding="${srcEncoding}" src="${srcDir}" dest="${tempDir}" includes="${filesRegex}" />
<native2ascii encoding="${destEncoding}" reverse="on" src="${tempDir}" dest="${destDir}" includes="${filesRegex}" />
<delete dir="${tempDir}"/>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment