Possibility to overwrite encoding for specific file types and / or files

Java properties files are by default encoded in ISO-8859-1 with Unicode escapes.
But source files are often encoded in UTF-8.
This is exactly the situation we have.

So we set sonar.sourceEncoding to UTF-8.
But now the analysis complained that in a properties file there was a character that is not valid in UTF-8.

In this case it actually was a mistake as an accent was used instead of an apostrophe.

But this can also happen with other characters.

So there should be some way to configure that certain files or groups of files have a different encoding.

1 Like