Skip to content
This repository has been archived by the owner on Oct 7, 2019. It is now read-only.

Source encoding not taken into account by the GUI #39

Open
VsevolodGolovanov opened this issue Apr 3, 2016 · 0 comments
Open

Source encoding not taken into account by the GUI #39

VsevolodGolovanov opened this issue Apr 3, 2016 · 0 comments

Comments

@VsevolodGolovanov
Copy link
Contributor

Say the source contains cyrillic symbols in UTF-8:

// провокация бага
public static SimpleDateFormat df = new SimpleDateFormat();

The platform encoding is the default Cp1251, so let's explicitly set all the possible encoding options in the pom:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>3.0.4-SNAPSHOT</version>
            <configuration>
                <jvmArgs>-Dfile.encoding=UTF-8</jvmArgs>
                <encoding>UTF-8</encoding>
                <sourceEncoding>UTF-8</sourceEncoding>
                <outputEncoding>UTF-8</outputEncoding>

Nope:
enc0

Let's check the GUI's JVM arguments with Visual VM:
jvmargs

It's got file.encoding (and others) set twice, and one of those is Cp1251. I suspect the duplicates come from clonevm=true.

mvn findbugs:gui log

Just to be sure that the source is right, let's force the encoding using the environment variable:

set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8

Now it works:
enc1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant