Hi

Is there a setting for the source encoding in the Project Build Plugin? Changing the default encoding (windows-1252) to UTF-8 results in a wrong class file.

For example the following class

public class Test {
    private String test = "Hans im Glück";
}

results in the following class file

....
Hans im Glück
....

Compiling in the Designer results in the correct

...
"Hans im Glück"
...

Regards

Michael

asked 23.09.2016 at 11:27

Michael's gravatar image

Michael
(suspended)
accept rate: 0%

edited 22.11.2016 at 13:57

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958

1

Hi Michael

Unfortunately there is no setting to change the encoding.
It seems that there is an issue with the Project Build Plugin, which leads to the wrong class file. We will analyze that and fix it in a future version.

Thank you for reporting this.

Kind regards Barbara

(26.09.2016 at 16:21) Barbara Brugger ♦♦ Barbara%20Brugger's gravatar image

We've introduced a new configuration parameter to set the 'encoding' for all sources of a project. http://axonivy.github.io/project-build-plugin/snapshot/6.3/compileProject-mojo.html#encoding

It is yet only possible to use this feature if you use the latest SNAPSHOT release of the project-build-plugin plus a nightly engine: http://developer.axonivy.com/dev-releases/nightly.html

We'd love to get feedback if this works for your project:

  <plugin>
    <groupId>com.axonivy.ivy.ci</groupId>
    <artifactId>project-build-plugin</artifactId>
    <version>6.3.1-SNAPSHOT</version>
    <extensions>true</extensions>
    <configuration>
        <encoding>UTF-8</encoding>
        <engineListPageUrl>http://developer.axonivy.com/dev-releases/nightly.html</engineListPageUrl>
    </configuration>
  </plugin>

you will also need a configuration to use sonatype snapshot repository in order to get this release:

<pluginRepositories>
        <!-- Snapshot releases are not deployed to maven central. So the repo on sonatype could be used instead -->
        <pluginRepository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <snapshots>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </pluginRepository>
</pluginRepositories>
link

answered 30.09.2016 at 09:38

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

edited 30.09.2016 at 09:45

Another solution to work around this problem is to keep the default encoding and encode special characters with embedded unicode chars by using \u

Example:

public class TestUnicode
{
  private static char UNICODE_UE = '\u00FC';

  @Test
  public void unicodeOut()
  {
    System.out.println("Hans im Gl"+UNICODE_UE+"ck");
  }
}
link

answered 25.10.2016 at 14:29

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×78
×22
×9
×5

Asked: 23.09.2016 at 11:27

Seen: 2,654 times

Last updated: 22.11.2016 at 13:57