timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

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

Open timja opened 9 years ago

timja commented 9 years ago

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

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


Originally reported by thelq, imported from: Viewing archived files with UTF8 text shows garbled output
  • status: Open
  • priority: Minor
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 9 years ago

danielbeck:

Please provide contents of the /systemInfo Jenkins URL.

timja commented 9 years ago

thelq:

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

timja commented 8 years ago

jungu:

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

timja commented 8 years ago

thelq:

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

timja commented 8 years ago

jungu:

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
    �[32m✓ 分组管理名称�[39m
�[32m.�[0m    �[32m✓ #25新增分组(åŒ…å«ç©ºæ ¼çš„å…¨è‹±æ–‡å)�[39m
�[32m.�[0m    �[32m✓ #25新增分组中文+英文+特殊字符�[39m
�[32m.�[0m    �[32m✓ #25不能创建相同分组名�[39m
�[32m.�[0m    �[32m✓ #25组名长度不能超过20�[39m
�[32m.�[0m    �[31m✗ #31改变分组�[39m
timja commented 8 years ago

hsehdar:

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

timja commented 4 years ago

ajaydwarkani:

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