This is a clone of
GROOVY-1276 which was marked accidently as duplicate of GROOVY-2745. But GROOVY-2745 fixes only the output enconding of the servlets. In GROOVY-1276 the srouce file encoding was meant.
In this aspect the functionality of the GroovyServlet should be aligned to the TemplateServlet. The TemplateServlet has the possibility to specify the source file encodig with the servlet init parameter groovy.source.encoding. This parameter should be read by the GroovyServlet too and the used GroovyScriptEngine should be accordingly configured.
The GroovyServlet should accept an init- parameter allowing to specify the encoding to use to read the Groovy scripts.
Currently the platform default value is used what would be the correct default value but the possibility to configure it is missing.
This is comparable to javac's -encoding command line flag (and probably Tomcat's JspServlet javaEncoding init-param, event if its description is not very clear).