Given enough occurrences of multi-byte UTF-8 characters in the output of a java task, Gradle will eventually mangle one of them, replacing each byte with 0xEFBFBD (replacement character). Some test code to reproduce this is available here: https://gist.github.com/raelik/3d04e5d942f01a6314af
Simply drop that UnicodeTest.java into an existing Gradle project that uses the java plugin, compile it, and then drop the unicode_test task into your build.gradle. Run the test code once through java on the command line and save the output (i.e. java -cp . UnicodeTest > cmd_output.txt), then run it through gradle (i.e. ./gradlew --quiet unicode_test 2>/dev/null > gradle_output.txt).
When you diff those files, you’ll see where gradle is dropping in the replacement characters.