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/07/23 16:24: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:
---------------------------------
    Environment:     (was: Operating system is z/OS 2.3. Shell is bash 4.3.46. Java is IBM Java 1.8.0_291.)

> 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
>            Reporter: Steve Dearth
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 2.5.16, 3.0.10, 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.10#820010)