Jenkins: console output characters

血红的双手。 提交于 2019-12-29 05:47:36

问题


Does anyone know how to beat such chars in Jenkins console output log?

Seems there is a problem with UTF-8.


回答1:


The issue here is that the characters are not being output as UTF-8 to your console. I think the solution is to tell jenkins when you invoke it to write output as UTF-8. See this solution for a similar problem UTF-8 char encoding does not work on console (Linux)

Something like java -Dfile.encoding=UTF-8 jenkins.war might do the trick




回答2:


In Jenkins ver. 2.46.2, I just got this to work by going to Nodes, Advanced settings, JVM Options and putting -Dfile.encoding=UTF8 and then taking that node offline and online again. Hope this helps other people. It would be great if UTF8 support was default.




回答3:


To give the the answer more complete. If you use an tomcat container to run jenkins, then edit catalina.sh config file:

vim apache-tomcat-path/bin/catalina.sh

Add -Dfile.encoding=UTF-8 to the JAVA_OPTS var and restart tomcat will do the trick.



来源:https://stackoverflow.com/questions/27960996/jenkins-console-output-characters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!