Steve Dearth created GROOVY-10483:
-------------------------------------
Summary: Source encoding incorrectly set in v4.0.0
Key: GROOVY-10483
URL: https://issues.apache.org/jira/browse/GROOVY-10483
Project: Groovy
Issue Type: Bug
Components: command line processing
Affects Versions: 4.0.0
Environment: Operating system is z/OS 2.3. Shell is bash 4.3.46. Java
is IBM Java 1.8.0_291.
Reporter: Steve Dearth
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.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)