title: Encoding in JUnit: Gradle vs Eclipse
body: <p>I have a project with some JUnit model tests, in Eclipse.</p>
  
  <p>One of these tests asserts some special characters. It passes in Eclipse (<code>Run As</code> -> <code>JUnit Test</code>), but fails when ran with Gradle (<code>clean test</code>).</p>
  
  <p>The failure: <code>org.junit.ComparisonFailure: expected:&lt;[ü]&gt; but was:&lt;[�]&gt;</code>, in the Gradle report.</p>
  
  <p>I've added <code>tasks.withType(JavaCompile) {options.encoding = 'UTF-8}</code> to the build file, which fixed the compile-time encoding issues. But I still get the run-time error (see the failure above).</p>
  
  <p>Adding <code>compileJava.options.encoding = 'UTF-8'</code> does not help.</p>
  
  <p>The test runs on MacOS, and the project encoding is inherited from the OS (Windows + UTF-8, in my case). </p>