Jenkins Plugin - Non-ASCII characters broken in build output if system encoding is not UTF-8

280 views
Skip to first unread message

Arend v. Reinersdorff

unread,
Jun 9, 2016, 8:35:10 AM6/9/16
to SonarQube
Hi,

here's a minor issue with the SonarQube Jenkins Plugin:
If the system encoding is not UTF-8, non-ASCII characters in the build output are broken. For example our nightly SonarQube build outputs all say at the top "Build wurde zeitgesteuert ausgel�st.".

Versions:
  • Jenkins 1.651.2 LTS
  • SonarQube Jenkins Plugin 2.4.3

Reproduce:

  1. Run Jenkins with a non-UTF-8 system encoding.
    • In my case Cp1252, german Windows encoding
    • Or set -Dfile.encoding=ISO-8859-1 at Jenkins startup
  2. Create a job that outputs some non-ASCII characters
    • For example Add build step > Execute Windows batch command > Insert command "echo ßönärQübe"
  3. Under build environment select checkbox Prepare SonarQube Scanner environment

Result is that the non-ASCII characters are broken, for example "��n�rQ�be".


Looking into the Github project I found a possible cause in MaskPasswordsOutputStream.eol(). The method assumes the underlying OutputStream is UTF-8 encoded. It looks more like the underlying stream uses the system  encoding.

Best regards,
Arend

Arend v. Reinersdorff

unread,
Jun 16, 2016, 2:53:24 AM6/16/16
to SonarQube
Any comment on this?

Julien HENRY

unread,
Jun 17, 2016, 9:01:16 AM6/17/16
to SonarQube
Hi Arend,

Thanks for feedback and good investigation.

I have created a ticket:

++

Julien

Julien HENRY

unread,
Jun 22, 2016, 3:22:32 AM6/22/16
to SonarQube
Hi Arend,

Would you mind testing the RC1 of 2.4.4 version to confirm the issue is fixed?

++

Julien

Arend v. Reinersdorff

unread,
Jun 30, 2016, 4:09:32 AM6/30/16
to SonarQube
Hi Julien,

thanks a lot for the fix :-) I just tested version 2.4.4 of the Jenkins plugin and it works well.

Sorry for not replying earlier, I have been sick for a week.

Best regards,
Arend

Julien HENRY

unread,
Jun 30, 2016, 8:52:35 AM6/30/16
to SonarQube
No problem Arend, I hope you are getting well. Thanks for the feedback.
Reply all
Reply to author
Forward
0 new messages