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

Viewing archived files with UTF8 text shows garbled output

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • Jenkins 1.616
      Server: Ubuntu 14.04.2 LTS
      Browser: Firefox, Chrome, or IE on both Windows 7 and Debian Linux

      Steps to reproduce
      1) Run a job that will archive a text file with UTF8 text
      2) On the job page under build artifacts view that file

      In my case on all major browsers on multiple OS's on different machines I get this when viewing the file through Jenkins:

      â ⠓⠑⠊⠣⠞⠀â ⠁⠃⠧⠀â ⠎⠑⠁⠀â ⠇⠑⠧⠑⠇

      instead of this (UTF8 braille) when viewing the file directly from the filesystem in a text editor

      ⠠⠓⠑⠊⠣⠞⠀⠠⠁⠃⠧⠀⠠⠎⠑⠁⠀⠠⠇⠑⠧⠑⠇

          [JENKINS-28676] Viewing archived files with UTF8 text shows garbled output

          Daniel Beck added a comment -

          Please provide contents of the /systemInfo Jenkins URL.

          Daniel Beck added a comment - Please provide contents of the /systemInfo Jenkins URL.

          Leon Blakey added a comment - - edited

          See below (didn't see a way to attach a file)

          System Properties
          Name ↓

          Value
          user.timezone America/New_York
          user.name jenkins
          user.language en
          user.home /var/lib/jenkins
          user.dir /
          user.country US
          sun.os.patch.level unknown
          sun.management.compiler HotSpot 64-Bit Tiered Compilers
          sun.jnu.encoding UTF-8
          sun.java.launcher SUN_STANDARD
          sun.java.command /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1
          sun.io.unicode.encoding UnicodeLittle
          sun.font.fontmanager sun.awt.X11FontManager
          sun.cpu.isalist
          sun.cpu.endian little
          sun.boot.library.path /opt/java-build/jdk1.8.0_40_x64/jre/lib/amd64
          sun.boot.class.path /opt/java-build/jdk1.8.0_40_x64/jre/lib/resources.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/rt.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/sunrsasign.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/jsse.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/jce.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/charsets.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/jfr.jar:/opt/java-build/jdk1.8.0_40_x64/jre/classes
          sun.arch.data.model 64
          securerandom.source file:/dev/./urandom
          path.separator :
          os.version 3.13.0-53-generic
          os.name Linux
          os.arch amd64
          mail.smtps.sendpartial true
          mail.smtp.sendpartial true
          line.separator
          lib.svnkit.ssh2.persistent false
          lib.svnkit.http.methods Digest,Basic,NTLM,Negotiate
          jnidispatch.path /tmp/jna--1712433994/jna3590656383749624890.tmp
          jna.platform.library.path /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:/lib64:/usr/lib:/lib
          java.vm.version 25.40-b25
          java.vm.vendor Oracle Corporation
          java.vm.specification.version 1.8
          java.vm.specification.vendor Oracle Corporation
          java.vm.specification.name Java Virtual Machine Specification
          java.vm.name Java HotSpot(TM) 64-Bit Server VM
          java.vm.info mixed mode
          java.version 1.8.0_40
          java.vendor.url.bug http://bugreport.sun.com/bugreport/
          java.vendor.url http://java.oracle.com/
          java.vendor Oracle Corporation
          java.specification.version 1.8
          java.specification.vendor Oracle Corporation
          java.specification.name Java Platform API Specification
          java.runtime.version 1.8.0_40-b26
          java.runtime.name Java(TM) SE Runtime Environment
          java.rmi.server.randomIDs true
          java.library.path /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
          java.io.tmpdir /tmp
          java.home /opt/java-build/jdk1.8.0_40_x64/jre
          java.ext.dirs /opt/java-build/jdk1.8.0_40_x64/jre/lib/ext:/usr/java/packages/lib/ext
          java.endorsed.dirs /opt/java-build/jdk1.8.0_40_x64/jre/lib/endorsed
          java.class.version 52.0
          java.class.path /usr/share/jenkins/jenkins.war
          java.awt.printerjob sun.print.PSPrinterJob
          java.awt.headless true
          java.awt.graphicsenv sun.awt.X11GraphicsEnvironment
          hudson.diyChunking true
          guice.disable.misplaced.annotation.check true
          file.separator /
          file.encoding.pkg sun.io
          file.encoding UTF-8
          executable-war /usr/share/jenkins/jenkins.war
          com.sun.management.jmxremote.ssl false
          com.sun.management.jmxremote.port 3333
          com.sun.management.jmxremote.authenticate false
          awt.toolkit sun.awt.X11.XToolkit
          Environment Variables
          Name ↓

          Value
          XFILESEARCHPATH /usr/dt/app-defaults/%L/Dt
          XDG_SESSION_ID 13
          XDG_RUNTIME_DIR /run/user/0
          USER jenkins
          TERM screen
          SHLVL 1
          SHELL /bin/bash
          PWD /var/lib/jenkins
          PATH /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/lib/jvm/java-6-oracle/bin:/usr/lib/jvm/java-6-oracle/db/bin:/usr/lib/jvm/java-6-oracle/jre/bin:/opt/dell/srvadmin/bin
          NLSPATH /usr/dt/lib/nls/msg/%L/%N.cat
          MAIL /var/mail/jenkins
          LOGNAME jenkins
          LANG en_US.UTF-8
          JENKINS_HOME /var/lib/jenkins
          JAVA_HOME /usr/lib/jvm/java-6-oracle
          J2SDKDIR /usr/lib/jvm/java-6-oracle
          J2REDIR /usr/lib/jvm/java-6-oracle/jre
          HOME /var/lib/jenkins
          DERBY_HOME /usr/lib/jvm/java-6-oracle/db
          _ /usr/bin/daemon
          Plugins
          Name ↓

          Version

          Enabled

          Pinned
          xvnc 1.21 true false
          ws-cleanup 0.26 true false
          windows-slaves 1.0 true false
          warnings 4.47 true false
          translation 1.12 true true
          token-macro 1.10 true false
          tasks 4.44 true false
          subversion 2.5 true true
          ssh-slaves 1.9 true false
          ssh-credentials 1.11 true true
          script-security 1.14 true true
          scm-api 0.2 true false
          pmd 3.41 true false
          pam-auth 1.2 true true
          mercurial 1.52 true false
          maven-plugin 2.9 true true
          matrix-project 1.4.1 true false
          matrix-auth 1.2 true true
          mapdb-api 1.0.6.0 true false
          mailer 1.15 true true
          ldap 1.11 true true
          junit 1.6 true true
          join 1.15 true false
          javadoc 1.3 true true
          gradle 1.24 true false
          git-client 1.17.1 true false
          git 2.3.5 true false
          findbugs 4.60 true false
          external-monitor-job 1.4 true false
          email-ext 2.40.4 true false
          dry 2.41 true false
          cvs 2.12 true true
          credentials 1.22 true true
          copyartifact 1.35.1 true false
          antisamy-markup-formatter 1.3 true true
          ant 1.2 true false
          analysis-core 1.71 true false
          analysis-collector 1.43 true false

          Leon Blakey added a comment - - edited See below (didn't see a way to attach a file) System Properties Name ↓ Value user.timezone America/New_York user.name jenkins user.language en user.home /var/lib/jenkins user.dir / user.country US sun.os.patch.level unknown sun.management.compiler HotSpot 64-Bit Tiered Compilers sun.jnu.encoding UTF-8 sun.java.launcher SUN_STANDARD sun.java.command /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1 sun.io.unicode.encoding UnicodeLittle sun.font.fontmanager sun.awt.X11FontManager sun.cpu.isalist sun.cpu.endian little sun.boot.library.path /opt/java-build/jdk1.8.0_40_x64/jre/lib/amd64 sun.boot.class.path /opt/java-build/jdk1.8.0_40_x64/jre/lib/resources.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/rt.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/sunrsasign.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/jsse.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/jce.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/charsets.jar:/opt/java-build/jdk1.8.0_40_x64/jre/lib/jfr.jar:/opt/java-build/jdk1.8.0_40_x64/jre/classes sun.arch.data.model 64 securerandom.source file:/dev/./urandom path.separator : os.version 3.13.0-53-generic os.name Linux os.arch amd64 mail.smtps.sendpartial true mail.smtp.sendpartial true line.separator lib.svnkit.ssh2.persistent false lib.svnkit.http.methods Digest,Basic,NTLM,Negotiate jnidispatch.path /tmp/jna--1712433994/jna3590656383749624890.tmp jna.platform.library.path /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:/lib64:/usr/lib:/lib java.vm.version 25.40-b25 java.vm.vendor Oracle Corporation java.vm.specification.version 1.8 java.vm.specification.vendor Oracle Corporation java.vm.specification.name Java Virtual Machine Specification java.vm.name Java HotSpot(TM) 64-Bit Server VM java.vm.info mixed mode java.version 1.8.0_40 java.vendor.url.bug http://bugreport.sun.com/bugreport/ java.vendor.url http://java.oracle.com/ java.vendor Oracle Corporation java.specification.version 1.8 java.specification.vendor Oracle Corporation java.specification.name Java Platform API Specification java.runtime.version 1.8.0_40-b26 java.runtime.name Java(TM) SE Runtime Environment java.rmi.server.randomIDs true java.library.path /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib java.io.tmpdir /tmp java.home /opt/java-build/jdk1.8.0_40_x64/jre java.ext.dirs /opt/java-build/jdk1.8.0_40_x64/jre/lib/ext:/usr/java/packages/lib/ext java.endorsed.dirs /opt/java-build/jdk1.8.0_40_x64/jre/lib/endorsed java.class.version 52.0 java.class.path /usr/share/jenkins/jenkins.war java.awt.printerjob sun.print.PSPrinterJob java.awt.headless true java.awt.graphicsenv sun.awt.X11GraphicsEnvironment hudson.diyChunking true guice.disable.misplaced.annotation.check true file.separator / file.encoding.pkg sun.io file.encoding UTF-8 executable-war /usr/share/jenkins/jenkins.war com.sun.management.jmxremote.ssl false com.sun.management.jmxremote.port 3333 com.sun.management.jmxremote.authenticate false awt.toolkit sun.awt.X11.XToolkit Environment Variables Name ↓ Value XFILESEARCHPATH /usr/dt/app-defaults/%L/Dt XDG_SESSION_ID 13 XDG_RUNTIME_DIR /run/user/0 USER jenkins TERM screen SHLVL 1 SHELL /bin/bash PWD /var/lib/jenkins PATH /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/lib/jvm/java-6-oracle/bin:/usr/lib/jvm/java-6-oracle/db/bin:/usr/lib/jvm/java-6-oracle/jre/bin:/opt/dell/srvadmin/bin NLSPATH /usr/dt/lib/nls/msg/%L/%N.cat MAIL /var/mail/jenkins LOGNAME jenkins LANG en_US.UTF-8 JENKINS_HOME /var/lib/jenkins JAVA_HOME /usr/lib/jvm/java-6-oracle J2SDKDIR /usr/lib/jvm/java-6-oracle J2REDIR /usr/lib/jvm/java-6-oracle/jre HOME /var/lib/jenkins DERBY_HOME /usr/lib/jvm/java-6-oracle/db _ /usr/bin/daemon Plugins Name ↓ Version Enabled Pinned xvnc 1.21 true false ws-cleanup 0.26 true false windows-slaves 1.0 true false warnings 4.47 true false translation 1.12 true true token-macro 1.10 true false tasks 4.44 true false subversion 2.5 true true ssh-slaves 1.9 true false ssh-credentials 1.11 true true script-security 1.14 true true scm-api 0.2 true false pmd 3.41 true false pam-auth 1.2 true true mercurial 1.52 true false maven-plugin 2.9 true true matrix-project 1.4.1 true false matrix-auth 1.2 true true mapdb-api 1.0.6.0 true false mailer 1.15 true true ldap 1.11 true true junit 1.6 true true join 1.15 true false javadoc 1.3 true true gradle 1.24 true false git-client 1.17.1 true false git 2.3.5 true false findbugs 4.60 true false external-monitor-job 1.4 true false email-ext 2.40.4 true false dry 2.41 true false cvs 2.12 true true credentials 1.22 true true copyartifact 1.35.1 true false antisamy-markup-formatter 1.3 true true ant 1.2 true false analysis-core 1.71 true false analysis-collector 1.43 true false

          Jun Gu added a comment -

          Hi thelq,
          did you resolve this issue?
          I find a same issue like this.
          Could you provide some solutions?

          Jun Gu added a comment - Hi thelq , did you resolve this issue? I find a same issue like this. Could you provide some solutions?

          Leon Blakey added a comment -

          I've only found not so great workarounds:

          1) Have a build script that cat's the files to the console, which displays correctly in the build's Console Output
          2) SSH into the server or mount $JENKINS_HOME and cat /var/lib/jenkins/jobs/myJob/workspace/myFile.txt

          Leon Blakey added a comment - I've only found not so great workarounds: 1) Have a build script that cat's the files to the console, which displays correctly in the build's Console Output 2) SSH into the server or mount $JENKINS_HOME and cat /var/lib/jenkins/jobs/myJob/workspace/myFile.txt

          Jun Gu added a comment -

          Ok,thank you.
          With my issue,the text of archived files and console logs of the job,they are all included some Chinese characters.
          And they will display garbled output in jenkins webpage,like below:

          groupManagerPage
              ✓ 分组管理名称
          .    ✓ #25新增分组(åŒ…å«ç©ºæ ¼çš„å…¨è‹±æ–‡å)
          .    ✓ #25新增分组中文+英文+特殊字符
          .    ✓ #25不能创建相同分组名
          .    ✓ #25组名长度不能超过20
          .    ✗ #31改变分组
          

          Jun Gu added a comment - Ok,thank you. With my issue,the text of archived files and console logs of the job,they are all included some Chinese characters. And they will display garbled output in jenkins webpage,like below: groupManagerPage ✓ 分组管理名称 . ✓ #25新增分组(åŒ…å«ç©ºæ ¼çš„å…¨è‹±æ–‡å) . ✓ #25新增分组中文+英文+特殊字符 . ✓ #25不能创建相同分组名 . ✓ #25组名长度不能超过20 . ✗ #31改变分组

          Radheshyam L added a comment -

          After upgrading Ubuntu 12.04 to Ubuntu 14.04, Jenkins pages have such characters.

          Radheshyam L added a comment - After upgrading Ubuntu 12.04 to Ubuntu 14.04, Jenkins pages have such characters.

          Ajay Kumar added a comment - - edited

          The fix for this would be set encoding in the response header to the below code when opening a text/log file.

          Content-Type: text/plain; charset=utf-8

          Currently, the request header is 

          Content-Type: text/plain

           I currently have a workaround by using requestly chrome plugin

          Ajay Kumar added a comment - - edited The fix for this would be set encoding in the response header to the below code when opening a text/log file. Content-Type: text/plain; charset=utf-8 Currently, the request header is  Content-Type: text/plain  I currently have a workaround by using requestly chrome plugin

          Ray Kivisto added a comment - - edited

          This change https://github.com/jenkinsci/jenkins/compare/master...rkivisto:JENKINS-28676 plus ensuring the instance has system property "-Dfile.encoding=UTF-8" fixes the issue.

          I'm now investigating what testcases may need to be created to get this accepted into core.

          Ray Kivisto added a comment - - edited This change https://github.com/jenkinsci/jenkins/compare/master...rkivisto:JENKINS-28676 plus ensuring the instance has system property "-Dfile.encoding=UTF-8" fixes the issue. I'm now investigating what testcases may need to be created to get this accepted into core.

          Ray Kivisto added a comment -

          Ray Kivisto added a comment - PR up for review https://github.com/jenkinsci/jenkins/pull/7308

            Unassigned Unassigned
            thelq Leon Blakey
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: