读源码看见一个配置类,EMMMM
ClassLoader parent = GroovyScript.class.getClassLoader();
CompilerConfiguration configuration = new CompilerConfiguration();
configuration.setSourceEncoding("UTF-8"); // 设置编码
GroovyClassLoader loader = new GroovyClassLoader(parent,configuration);