-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New rule: ISO-8859-1 characters not compatible with UTF-8 should be escaped to keep compatibility with Java 9 default encoding switch #75
Comments
Thanks for the info and the link! David |
Depends upon #76 |
@arend-von-reinersdorff: What about the following rule description?
|
Great work, and very nice description. Thanks a lot :-) |
You're welcome! Here's a snapshot to test: https://github.com/racodond/sonar-jproperties-plugin/releases/tag/%2375 Your feedback is more than welcome! |
I tried to trigger the new issue but didn't manage. My setup:
I was able to trigger another issue in my test.properties file but not this new one. At first I used UTF-8 as Maven project encoding and ISO-8859-1 as encoding for the property file (this should be the normal case). This caused a warning on analysis: When I changed the Maven project encoding to ISO-8859-1 (ugly workaround) the warning disappeared but the issue was still not triggered. Non-ASCII characters looked fine in the SonarQube server view. Unrelated problems in testing this:
|
Thanks for your feedback!
It works fine on my side with your settings with the following project sample: My apologies to ask :-):
Can you try again with my sample project?
Of course, the proper settings should be:
But, currently, no language plugin seems to support files with different encodings. I asked about it here. Unfortunately, it is likely that SonarSource doesn't answer the thread as they don't really welcome language plugins from the community. I'll try to keep investigating to find a workaround when I have some time.
README file updated
This is related to the SonarQube Maven plugin that only looks for files in David |
You are right, the rule was not activated, sorry. |
Good news! |
Java 9 will switch the default property encoding from ISO-8859-1 to UTF-8:
http://openjdk.java.net/jeps/226
This will lead to garbled input if a .properties file for Java 8 or earlier is read by Java 9 in case it
contains non-ASCII, non-escaped characters. Eg:
admin.name=Jörg Schäfer
A .properties file that should be read by Java 9 and Java 8 or earlier should escape all non-ASCII characters.
The text was updated successfully, but these errors were encountered: