jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • GRECLIPSE
  • GRECLIPSE-3

Plugin Compiler does not honour Eclipse preferences for file encoding

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.0.0m1
  • Component/s: Compiler Integration
  • Labels:
    None

Description

In Eclipse preferences, you can choose an encoding for files.

The Groovy plugin doesn't seem to use this setting, but relies on Java file.encoding to select the encoding for reading files. Therefore, Groovy scripts/classes stored in UTF-8 using extended characters are misinterpreted by the plugin.

On Windows, the following script

def s = "äöü" // German umlauts
println s.size()

prints 6 on my machine. After setting file.encoding=UTF-8 as Eclipse startup option the script prints 3 correctly.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Michael Baehr added a comment - 23/Mar/07 6:57 PM

Actually, Eclipse allows to change the encoding per file, so the plugin should access this information and setup the compiler configuration accordingly on a file by file basis!

Show
Michael Baehr added a comment - 23/Mar/07 6:57 PM Actually, Eclipse allows to change the encoding per file, so the plugin should access this information and setup the compiler configuration accordingly on a file by file basis!
Hide
Permalink
Alexandre Rafalovitch added a comment - 23/Mar/08 2:01 AM

This issue still exists with the latest eclipse (3.3.2), groovy (1.5.4) and the production plugin (GroovyFeature 1.5.1) on Windows (Vista). I have double-checked that my file's properties show UTF-8 as encoding (actually, my whole environment does).

I can reproduce the behavior, by running groovy with no flags on a command line. Then, if I supply -c UTF8, the problem goes away.

However, I do not see a way to pass the flag to the plugin as a workaround, so this is really a show-stopper for the plugin.

Show
Alexandre Rafalovitch added a comment - 23/Mar/08 2:01 AM This issue still exists with the latest eclipse (3.3.2), groovy (1.5.4) and the production plugin (GroovyFeature 1.5.1) on Windows (Vista). I have double-checked that my file's properties show UTF-8 as encoding (actually, my whole environment does). I can reproduce the behavior, by running groovy with no flags on a command line. Then, if I supply -c UTF8, the problem goes away. However, I do not see a way to pass the flag to the plugin as a workaround, so this is really a show-stopper for the plugin.
Hide
Permalink
Stefan Hübner added a comment - 09/Oct/08 3:52 AM

This issue is a pain and should be fixed.

Michael Baehr wrote:

Actually, Eclipse allows to change the encoding per file, so the plugin should access this information and setup the compiler configuration accordingly on a file by file basis!

I have the feeling, this is a bit too much a requirement. In comparision, does the Eclipse Java builder respect encoding settings on a file-by-file basis? Or does it rather respect the environment settings – aka project-specific settings (if configured) and workspace settings? I actually havn't checked that yet.

Anyhow, I would recommend the Groovy builder to follow the same lines as the Java builder.

Show
Stefan Hübner added a comment - 09/Oct/08 3:52 AM This issue is a pain and should be fixed. Michael Baehr wrote:
Actually, Eclipse allows to change the encoding per file, so the plugin should access this information and setup the compiler configuration accordingly on a file by file basis!
I have the feeling, this is a bit too much a requirement. In comparision, does the Eclipse Java builder respect encoding settings on a file-by-file basis? Or does it rather respect the environment settings – aka project-specific settings (if configured) and workspace settings? I actually havn't checked that yet. Anyhow, I would recommend the Groovy builder to follow the same lines as the Java builder.
Hide
Permalink
Michel Löhr added a comment - 06/Apr/09 3:40 AM

We have a Cp1252 encoded Groovy project for automatic GUI testing where we use special characters (üöäß) because we use a german DSL. But now we need to switch to UTF-8 because of multi platform / version control.

Currently UFT-8 encoding and special characters gives errors (unexpected characters) using the Eclipse Groovy plugin when using them in class and method names.

Java classes don't not have a problem having special UTF-8 encoded characters in class and or method names.

This a a pain in the ass, to reconfirm Stefan above!

We need this support badly because we cannot correctly see changes when merging (now every use of a special char is a change)

Show
Michel Löhr added a comment - 06/Apr/09 3:40 AM We have a Cp1252 encoded Groovy project for automatic GUI testing where we use special characters (üöäß) because we use a german DSL. But now we need to switch to UTF-8 because of multi platform / version control. Currently UFT-8 encoding and special characters gives errors (unexpected characters) using the Eclipse Groovy plugin when using them in class and method names. Java classes don't not have a problem having special UTF-8 encoded characters in class and or method names. This a a pain in the ass, to reconfirm Stefan above! We need this support badly because we cannot correctly see changes when merging (now every use of a special char is a change)
Hide
Permalink
Andrew Eisenberg added a comment - 01/Aug/09 11:19 PM

Fixed in V2.0 because it uses the javaBuilder.

Show
Andrew Eisenberg added a comment - 01/Aug/09 11:19 PM Fixed in V2.0 because it uses the javaBuilder.

People

  • Assignee:
    Andrew Eisenberg
    Reporter:
    Michael Baehr
Vote (4)
Watch (3)

Dates

  • Created:
    23/Mar/07 4:10 PM
    Updated:
    16/Mar/11 3:39 PM
    Resolved:
    01/Aug/09 11:19 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.