Sonar

JavaNCSS doesn't correctly manage non UTF-8 characters

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.6
  • Fix Version/s: 1.9
  • Component/s: Squid
  • Labels:
    None
  • Number of attachments :
    0

Description

When a project contains a method wich have non UTF-8 character and the encoding is specified explicitly, as in:

mvn -Dfile.encoding=iso-8859-1 org.codehaus.sonar:sonar-maven-plugin:1.6:sonar

Sonar throws the following error:

[ERROR] Cannot execute the command org.codehaus.sonar:sonar-core-maven-plugin:1.6:collect
org.sonar.plugins.api.maven.xml.XmlParserException: can not parse xml :
<?xml version="1.0"?>
<javancss>
...
</javancss>
Invalid byte 2 of 3-byte UTF-8 sequence
[Fatal Error] :22670:89: Invalid byte 2 of 3-byte UTF-8 sequence.

The problem with JavaNCSS is that it doesn't correctly manage non UTF-8 character, when the encoding to be used is explicitly defined, this encoding should be mentioned in the <?xml version="1.0"?> header.

Issue Links

Activity

Hide
Pablo Nieloud added a comment -

I forgot to mention that the problem appear with a method that contains an í. I just renamed that method and the problem disappear.

Show
Pablo Nieloud added a comment - I forgot to mention that the problem appear with a method that contains an í. I just renamed that method and the problem disappear.
Hide
Freddy Mallet added a comment -

Thanks Pablo for this notification

Show
Freddy Mallet added a comment - Thanks Pablo for this notification
Hide
Cédric Munger added a comment -

The new sonar squid lib use should fix the issue, you will still need to define the correct project files character set using the -Dfile.encoding=$CHARSET JVM param when launching the sonar plugin

Show
Cédric Munger added a comment - The new sonar squid lib use should fix the issue, you will still need to define the correct project files character set using the -Dfile.encoding=$CHARSET JVM param when launching the sonar plugin

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: