spotbugs / spotbugs-maven-plugin

Maven Mojo Plug-In to generate reports based on the SpotBugs Analyzer
https://spotbugs.github.io/spotbugs-maven-plugin/
Apache License 2.0
80 stars 54 forks source link

Default encoding should be UTF-8 #946

Open elharo opened 3 days ago

elharo commented 3 days ago

From the SpotBugs mojo

    /**
     * The file encoding to use when creating the HTML reports. If the property <code>project.reporting.outputEncoding</code>
     * is not set, the platform default encoding is used.
     *
     * @since 2.2
     */
    @Parameter(defaultValue = '${project.reporting.outputEncoding}', property = 'outputEncoding')
    String outputEncoding

In 2024 platform default encoding is almost never a good idea. The default should be UTF-8. On Mac OS X or in JDK 21, the default encoding is likely to be UTF-8 anyway.

https://openjdk.org/jeps/400

hazendaz commented 1 day ago

Actually it probably is internally UTF_8 everywhere it not supplied because that is all I've used in more than a decade at this point. I'll review as it may just be that the javadoc is entirely wrong now.