title: How to automatically escape unicode characters in Java property files using Gradle?
body: <p>I'm translating a <strong>Java</strong> application by using a <code>ResourceBundle</code> with various <code>*.properties</code> files. Now I like to have a <strong>Gradle</strong> task or want to modify a task to automatically escape any <em>unicode</em> character by replacing it with its <em>ASCII</em> representation, something like Java's <code>native2ascii</code> tool does.</p>
  
  <p>This is what I'm done so far with my build file, but the <strong>output remains unescaped</strong>:</p>
  
  <pre><code>import org.apache.tools.ant.filters.EscapeUnicode
  
  tasks.withType(ProcessResources) {
      filesMatching('**/*.properties') {
          println "\t-&gt; ${it}"
          filter EscapeUnicode
      }
  }
  </code></pre>
  
  <p><em>Any help is appreciated.</em></p>