Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-13838

Console output encoding issues (unicode)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: core
    • Labels:
    • Environment:
    • Similar Issues:

      Description

      My case is running vows tests which output uses lots of funky utf8 chars like ✓ for example.
      The console output then is barely readable.

      Forget vows the case can be easy reproduced:

      • scenario I: build script from jenkins with utf8 char
      • scenario II: build script that outputs utf8 char

      I am particularly interested in scenario II. And trust me its not only about one ✓ char there is much more making it unpleasant to use.

      Made my homework and searched for duplicates/solution:

      Some more people possibly with the same problem:

        Attachments

        1. scenario I input.png
          scenario I input.png
          20 kB
        2. scenario I output.png
          scenario I output.png
          27 kB
        3. scenario II input.png
          scenario II input.png
          21 kB
        4. scenario II output.png
          scenario II output.png
          29 kB

          Activity

          Hide
          buzzar Lukasz Dobrzanski added a comment -

          Checking the HTTP response gives:

          • proper
            Content-Type: text/html;charset=UTF-8
          • instead of sending bytes
            e2 9c 93

            U+2713 ✓ I am getting

            e2 80 9a c3 ba c3 ac

            ‚úì

          Show
          buzzar Lukasz Dobrzanski added a comment - Checking the HTTP response gives: proper Content-Type: text/html;charset=UTF-8 instead of sending bytes e2 9c 93 U+2713 ✓ I am getting e2 80 9a c3 ba c3 ac ‚úì
          Hide
          gabriel_falkenberg Gabriel Falkenberg added a comment -

          This is most likely caused by OSX's default character encoding being MacRoman. Have a look at: <jenkinshost>/systemInfo and see what file.encoding is set to.

          Starting Jenkins like this solves the problem for me:

          JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8" java -jar jenkins.war

          Please note that only console output created when the character encoding has been changed will look correct. Old console output will still look weird. This hints that the console output is actually transformed before being saved to disk which doesn't seem right to me.

          Show
          gabriel_falkenberg Gabriel Falkenberg added a comment - This is most likely caused by OSX's default character encoding being MacRoman. Have a look at: <jenkinshost>/systemInfo and see what file.encoding is set to. Starting Jenkins like this solves the problem for me: JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8" java -jar jenkins.war Please note that only console output created when the character encoding has been changed will look correct. Old console output will still look weird. This hints that the console output is actually transformed before being saved to disk which doesn't seem right to me.
          Hide
          evernat evernat added a comment -

          Is it reproduced with a recent Jenkins version?

          Show
          evernat evernat added a comment - Is it reproduced with a recent Jenkins version?
          Hide
          sharplet Adam Sharp added a comment -

          I've had the same issue in Jenkins ver. 1.546.

          Show
          sharplet Adam Sharp added a comment - I've had the same issue in Jenkins ver. 1.546.
          Hide
          sylvain_mougenot Sylvain Mougenot added a comment -

          A workaround is to set java to use UTF-8 encoding as default (-Dfile.encoding=UTF8).

          Add "-Dfile.encoding=UTF8" in :

          • master jenkins set the property JENKINS_JAVA_OPTIONS in the file /etc/sysconfig/jenkins
          • node configuration (jenkins web ui), in the advanced section, add in the jvm options parameter

          You need to restart jenkins and the nodes (disconnect / reconnect).

          Will only solve it on the new builds

          Show
          sylvain_mougenot Sylvain Mougenot added a comment - A workaround is to set java to use UTF-8 encoding as default (-Dfile.encoding=UTF8). Add "-Dfile.encoding=UTF8" in : master jenkins set the property JENKINS_JAVA_OPTIONS in the file /etc/sysconfig/jenkins node configuration (jenkins web ui), in the advanced section, add in the jvm options parameter You need to restart jenkins and the nodes (disconnect / reconnect). Will only solve it on the new builds
          Hide
          danielbeck Daniel Beck added a comment -

          This appears to be a configuration issue rather than a bug, that has been solved in newer OS X (or Java on OS X) versions when it default to UTF-8 instead of MacRoman.

          If this still occurs on recent versions of Jenkins and cannot be solved by properly configuring Jenkins for UTF-8, please file a new issue.

          Show
          danielbeck Daniel Beck added a comment - This appears to be a configuration issue rather than a bug, that has been solved in newer OS X (or Java on OS X) versions when it default to UTF-8 instead of MacRoman. If this still occurs on recent versions of Jenkins and cannot be solved by properly configuring Jenkins for UTF-8, please file a new issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              buzzar Lukasz Dobrzanski
            • Votes:
              6 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: