There is no problem with UTF-8 output in build.gradle like:
println "測試" //in build.gradle
But if I do the same thing in Groovy classes. The result output to console is in wrong encoding even add ‘-Dfile.encoding=utf8’ to JAVA_OPTS. Following code is the task definition.
task (runSimple, dependsOn: 'classes', type: JavaExec) {
main = 'com.example.SimpleSMS'
classpath = sourceSets.main.runtimeClasspath
}
Is there a gradle way to specify correct encoding?