groovyc と groovyc Antタスクが --encoding をサポート
>maven -Dmaven.test.skip=true groovy:make-install >set GROOVY_HOME=target/install >type test.SJIS.groovy class Main { public static void main(String[] args) { println("file.encoding=" + System.getProperty("file.encoding")); println("groovyで日本語表示(Shift_JIS)") } } >groovyc test.SJIS.groovy >java -classpath .;%GROOVY_HOME%\lib\groovy-1.0-rc1-snapshot.jar;%GROOVY_ HOME%\lib\asm-1.4.1.jar; Main file.encoding=MS932 groovyで日本語表示(Shift_JIS) >type test.EUC.groovy class Main { public static void main(String[] args) { println("file.encoding=" + System.getProperty("file.encoding")); print("groovy、ヌニ・ワク・スシィ(EUC-JP)") } } >groovyc test.EUC.groovy >java -classpath .;%GROOVY_HOME%\lib\groovy-1.0-rc1-snapshot.jar;%GROOVY_ HOME%\lib\asm-1.4.1.jar; Main file.encoding=MS932 groovy、ヌニ?ワク?スシィ(EUC-JP) >groovyc --encoding EUC-JP test.EUC.groovy >java -classpath .;%GROOVY_HOME%\lib\groovy-1.0-rc1-snapshot.jar;%GROOVY_ HOME%\lib\asm-1.4.1.jar; Main file.encoding=MS932 groovyで日本語表示(EUC-JP) >