Context:
SonarScanner.MSBuild.exe encoding is kept at platform default “windows-1252”.
In the scanner log this is confirmed as follows:
INFO: Analyzing on SonarQube server 9.9.0.65466
INFO: Default locale: “en_US”, source code encoding: “windows-1252” (analysis is platform dependent)
Problem:
Despite the enconding setting some files are skipped, log message states that SonarScanner is set to encoding UTF-8:
WARN: Encoding detected by Roslyn and encoding used by SonarQube do not match for file file:C:/test/samplefile.cs. SonarQube encoding is ‘UTF-8’, Roslyn encoding is ‘windows-1252’. File will be skipped
.