title: Gradle - change Java compiler output locale or encoding
body: <p>Can one configure Gradle to change java compiler output locale or encoding?</p>
  
  <p>The problem: gradle in run on Windows with non English default Local (in particular it is Chinese)</p>
  
  <p>There is possibility to do that configuring Java, e.g. <a href="https://stackoverflow.com/questions/64038/setting-java-locale-settings">Setting java locale settings</a> .  </p>
  
  <p>Can Gradle do (that is just for this build, CI job) ?</p>
  
  <p>UPDATE:</p>
  
  <p>As Vadim referenced, for source encoding, this snippet is used.</p>
  
  <pre><code>tasks.withType(Compile) {
      options.encoding = 'UTF-8'
  }
  </code></pre>
  
  <p>Details: Gradle calls Java compile, that defaults to system Locale (in my case it is Chinese). So when error appears, it is shown in Chinese. Java documentation says to configure via environment variable. But I want to do it only for this <code>build.gradle</code>
  ... Possibly I need to change that environment variable before and after compilation automatically, it Gradle does not provide such costomization.</p>