JavaExec task mangles UTF-8 output


(Blane Dabney) #1

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:

Simply drop that 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.

(Lóránt Pintér) #2

Thanks for sending this in. Managed to reproduce the problem, and created an issue:

(Lari Hotari) #3

GRADLE-3329 has been fixed by . This will be included in 3.2-rc-1 .