Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-10483

Source encoding incorrectly set in v4.0.0

    XMLWordPrintableJSON

Details

    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. 

      Attachments

        Activity

          People

            emilles Eric Milles
            sdearth Steve Dearth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: