As I said, my “shell” is the Windows command prompt.
Well, you’ll never stop to learn… I was almost sure the Windows command prompt used the cp1252 character set by default, since this is the default o.s. file encoding… however, this is not true!
It turns out that the default character set used by the Windows command prompt is cp850, which explains why I see garbage. In fact, also: type build.gradle shows the garbage in the string argument of logger.lifecycle(…).
But this is not the whole story. If you type the command “chcp” you’ll see that the default charset is cp850. But even if you change it to cp1252 using “chcp 1252”, the “type build.gradle” command or the “gradlew” launching will still produce garbage. Looking at the following: http://stackoverflow.com/questions/1259084/what-encoding-code-page-is-cmd-exe-using I’ve discovered that to make the console react as it should to the change of the charset, you must configure the Windows command prompt to use the Lucida Console or Consolas fonts instead of the “raster fonts” (which is the default!!!).
So, to sum it up, to make it work correctly you have to: - change the options of the Windows command prompt to use the Lucida Console or Consolas font - type "chcp " to set the correct codepage (1252 in my example) - ensure that the build script is edited with the correct encoding - ensure that Gradle is using the correct encoding to load the script, using GRADLE_OPTS to set the file.encoding system property if needed
Maybe this can be useful to you to know, too. Thanks for the hint to discover this!