Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
4.0.0
-
None
Description
I'm using groovy on z/OS, so all of my files are encoded in IBM-1047. In Groovy 2.4.x, if the -c option isn't passed to groovy, the value of file.encoding would be used as the source encoding value. This allowed us to keep our source files in EBCDIC. In v4.0.0, if -c isn't set, the source encoding defaults to UTF-8, requiring us to set the encoding on the command line every time. This appears to be a bug in groovy.ui.GroovyMain. Looking at the source for this class, it looks like it properly sets up the encoding values using the CompilerConfiguration constructor, but then on line 254 it calls CompilerConfiguration.setSourceEncoding() with the value of the command line option, which is null if not set on invocation. This causes a fallback to the default UTF-8 encoding.