Our firm is based in a french region of Canada, so, in comments, we use accented characters like é, à, û and such.
So, our source code is normally encoded in Windows-1252 which happens to be the default encoding for our region.
However, when I scan without specifying anything special, I got the dreaded following error:
SonarQube encoding is ‘UTF-8’, Roslyn encoding is ‘windows-1252’. File will be skipped.
But for some files only. Seems that Roslyn is encoding UTF-8 when it can…
So, I tried to use /d:sonar.sourceEncoding=windows-1252 in the parameters of the scanner
And… It was worse (as there are more files with no accents): All the files that were Windows-1252 were now imported but files that are UTF-8 were not!
SonarQube encoding is ‘windows-1252’, Roslyn encoding is ‘UTF-8’. File will be skipped.
So, I tried converting all code to UTF-8
But now, I got MSBuild that crashes with an error of invalid <?> character!
Then I tried reverting to the original code and converting everything in Windows-1252
And I still got the following error:
SonarQube encoding is ‘windows-1252’, Roslyn encoding is ‘UTF-8’. File will be skipped.
Please help me, I’m going insane.