Open CarstenNeumannHB opened 1 month ago
the output ([INFO] Checkstyle charset: windows-1252
) shows that Checkstyle uses the windows-1252
charset. this charset doesn't contain these special characters, so Checkstyle cannot interpret them correctly.
i don't think this is related to the Checkstyle upgrade. SQ (scanners) usually use the system encoding unless SQ was configured to use a specific encoding (e.g., UTF-8).
fyi, i have copied your code using SQ 10.7 (containerized) and analysis runs through smoothly. additionally, you can try running the CS cli using your configuration to see if this is an issue caused by CS itself.
Hi,
sorry for the late reply. We run our analysis on a Windows system, not containerized, maybe this makes a difference. Do we have to explicitly provide the right charset somehow? The analysis with CS itself runs fine, as you can see in my first post.
Thanks!
The latest checkstyle uses utf 8 by default unless an override is sent to it (by configuration file or by setting directly).
I don't know sonar, but the windows charset output looks it comes from sonar inside CheckstyleConfiguration
where it gets the value from fileSystem.encoding
. That is sonar's api (not native file system). Sonar says it's the project's charset, so maybe look at the project settings or global project settings.
Sonar version: 10.7 (was 10.4) Checkstyle sonar plugin version: 10.17.0 (was 10.12.5)
Hi,
since we upgraded Sonar and Checkstyle an exception occurs while performing the checkstyle analysis:
Console output:
Error message:
With Checkstyle the analysis on this file can be performed:
This is the affected file:
As you can see, it contains several German umlauts. The highlighted console output as well mentions one of them. With former versions of SonarQube and Checkstyle-Plugin this file didn't cause any problems and it hasn't been changed since.
Thanks!
Regards, Carsten