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)
  • GMaven
  • GMAVEN-13

sourceEncoding doesn't work

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Duplicate
  • Affects Version/s: 1.0
  • Fix Version/s: 1.3
  • Component/s: compile
  • Labels:
    None

Description

When I set sourceEncoding to UTF-8 this setting is ignored and groovy script is still compiled probably using platform default encoding.

I can see that sourceEncoding is properly set to UTF-8 in debug log :

[DEBUG]Configuring mojo 'org.codehaus.groovy.maven:gmaven-plugin:1.0-rc-5-kohsuke-1:compile' -->
...
[DEBUG] (f) sourceEncoding = UTF-8
...
[DEBUG]-- end configuration –

Strings that originaly contained multi-byte UTF-8 characters are damaged in compiled class file.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    ClassCompilerFeature.java.diff
    22/Jul/09 10:29 AM
    1 kB
    Matthias Bohlen

Issue Links

is duplicated by

Bug - A problem which impairs or prevents the functions of the product. GMAVEN-65 Impossible to set any compiler configuration (sourceEncoding etc.)

  • Blocker - Blocks development and/or testing work, production could not run
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Matthias Bohlen added a comment - 22/Jul/09 3:12 AM

Got the same problem!

Hey guys, this issue is extremely important for the Asian and the European markets! We here in Germany have umlaut characters like "äöüÄÖÜß" - they are part of our language! We need to compile them correctly in Groovy! The Asian people have many many more special characters so that they also need UTF-8. Please, please, make this work!

Show
Matthias Bohlen added a comment - 22/Jul/09 3:12 AM Got the same problem! Hey guys, this issue is extremely important for the Asian and the European markets! We here in Germany have umlaut characters like "äöüÄÖÜß" - they are part of our language! We need to compile them correctly in Groovy! The Asian people have many many more special characters so that they also need UTF-8. Please, please, make this work!
Hide
Permalink
Matthias Bohlen added a comment - 22/Jul/09 10:29 AM

The reason for the erroneous behavior was that the compiler options got lost before they could be passed to the compiler. This is because AbstractCompileMojo fills them AFTER ClassCompilerFeature needs them.

I moved the code that copies the compiler options into another place, right before the point where the Groovy compiler is invoked.

The change is attached to this Jira issue, now. The file name is ClassCompilerFeature.java.diff. Could you please apply the patch to the source code?

Thanks!

Show
Matthias Bohlen added a comment - 22/Jul/09 10:29 AM The reason for the erroneous behavior was that the compiler options got lost before they could be passed to the compiler. This is because AbstractCompileMojo fills them AFTER ClassCompilerFeature needs them. I moved the code that copies the compiler options into another place, right before the point where the Groovy compiler is invoked. The change is attached to this Jira issue, now. The file name is ClassCompilerFeature.java.diff. Could you please apply the patch to the source code? Thanks!
Hide
Permalink
Matthias Bohlen added a comment - 23/Jul/09 2:09 AM

I found a workaround. Before you start Maven, set the variable MAVEN_OPTS.

Windows:
set MAVEN_OPTS=-Dgroovy.source.encoding=UTF-8

Mac/Linux/Unix (bash):
export MAVEN_OPTS=-Dgroovy.source.encoding=UTF-8

This causes the Groovy compiler to recognize the encoding of the source files.

Show
Matthias Bohlen added a comment - 23/Jul/09 2:09 AM I found a workaround. Before you start Maven, set the variable MAVEN_OPTS. Windows: set MAVEN_OPTS=-Dgroovy.source.encoding=UTF-8 Mac/Linux/Unix (bash): export MAVEN_OPTS=-Dgroovy.source.encoding=UTF-8 This causes the Groovy compiler to recognize the encoding of the source files.
Hide
Permalink
Jason Smith added a comment - 10/Aug/09 10:58 AM

I've promoted this from "Major" to "Critical."

Show
Jason Smith added a comment - 10/Aug/09 10:58 AM I've promoted this from "Major" to "Critical."
Hide
Permalink
Keegan Witt added a comment - 02/Jun/10 12:45 PM

Actually it doesn't look like it's even using the platform default encoding. I tried on Linux where the platform default encoding is UTF-8 and on Windows where the platform default encoding is Windows-1252. In both cases, it used ISO-8859-1 as the encoding of the class file generated, despite the fact the source was encoded in the platform default encoding. I tested this with version 1.2 of the plugin and Groovy 1.7.0. I don't understand how this is happening. It's been almost a year since this issue has been updated. Does the supplied patch work?

Show
Keegan Witt added a comment - 02/Jun/10 12:45 PM Actually it doesn't look like it's even using the platform default encoding. I tried on Linux where the platform default encoding is UTF-8 and on Windows where the platform default encoding is Windows-1252. In both cases, it used ISO-8859-1 as the encoding of the class file generated, despite the fact the source was encoded in the platform default encoding. I tested this with version 1.2 of the plugin and Groovy 1.7.0. I don't understand how this is happening. It's been almost a year since this issue has been updated. Does the supplied patch work?
Hide
Permalink
Ronny Løvtangen added a comment - 03/Jun/10 11:13 AM

I think this is the same issue as GMAVEN-65.
Both jiras have a patch attached, but none of them are scheduled for any release.
This is critical for all languages with more letters than a-z. Can this fix be included in the 1.3 release? Please

Show
Ronny Løvtangen added a comment - 03/Jun/10 11:13 AM I think this is the same issue as GMAVEN-65. Both jiras have a patch attached, but none of them are scheduled for any release. This is critical for all languages with more letters than a-z. Can this fix be included in the 1.3 release? Please
Hide
Permalink
Yasuharu NAKANO added a comment - 28/Jun/10 2:02 AM

I've gotten the same problem!
Please fix it and release the bug fix version.

Show
Yasuharu NAKANO added a comment - 28/Jun/10 2:02 AM I've gotten the same problem! Please fix it and release the bug fix version.

People

  • Assignee:
    Jason Dillon
    Reporter:
    Vojtech Habarta
Vote (7)
Watch (5)

Dates

  • Created:
    26/Jun/09 3:34 AM
    Updated:
    05/Jul/10 3:49 PM
    Resolved:
    05/Jul/10 3:49 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.