You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/02/16 21:42:00 UTC
[jira] [Updated] (GROOVY-10483) Source encoding incorrectly set in v4.0.0
[ https://issues.apache.org/jira/browse/GROOVY-10483?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-10483:
---------------------------------
Fix Version/s: 4.0.1
> 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
> Assignee: Eric Milles
> Priority: Minor
> Fix For: 5.0.0-alpha-1, 4.0.1
>
>
> 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)