Jenkins: console output characters

后端 未结 3 761
眼角桃花
眼角桃花 2020-12-16 14:06

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

Seems there is a problem with UTF-8.

<script

相关标签:
3条回答
  • 2020-12-16 14:18

    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.

    0 讨论(0)
  • 2020-12-16 14:36

    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. enter image description here

    0 讨论(0)
  • 2020-12-16 14:39

    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

    0 讨论(0)
提交回复
热议问题