1

I've encountered some issues while using Jenkins and would like to seek your assistance. The specific problem is as follows:

I have already tried using -Dsun.jnu.encoding=utf-8, but unfortunately, it didn't have the intended effect. I've thoroughly checked, and the Linux locale is already set to en_US UTF-8. However, the systemInfo in Jenkins consistently displays as ANSI_X3.4-1968, which has left me quite puzzled. Currently, my hypothesis is that Jenkins might be overwriting this property setting, although I'm uncertain about the exact reasons behind it. I'm hoping you could provide clarity to my confusion. Thank you very much.

Jenkins service status

Jenkins user locale information

'mvn' command in bash

'mvn' command in Jenkins

The following is the version information:

java: java 17.0.8 maven: Apache Maven 3.8.5 Jenkins: Jenkins 2.414.1

Use the following command to add java properties, but doesn't work.

sudo systemctl edit jenkins.service

ANSI_X3.4-1968 causes some characters to be garbled, but through the following methods, it can be temporarily solved, but the root cause is still not found

environment {
    LC_ALL = 'en_US.UTF-8'
    LANG    = 'en_US.UTF-8'
    LANGUAGE = 'en_US.UTF-8'
}
g00se
  • 3,207
  • 2
  • 5
  • 9
Weir Lee
  • 11
  • 1
  • 1
    *I have already tried using -Dsun.jnu.encoding=utf-8* AFAIK, that property is read-only. [Please never post images of text](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors/285557#285557). They are not searchable, we cannot copy-paste... Always copy-paste the text and format it properly. – g00se Aug 27 '23 at 11:08
  • According to https://stackoverflow.com/questions/46112011 you should use `-Dfile.encoding=UTF-8` – Stephen C Aug 27 '23 at 15:20

1 Answers1

0

Try to set the locale in .bashrc and .bash_profile in /home/jenkins/.

Check also if you have the locale plugin installed in Jenkins.

You can also install this plugin to better control you locales.

Ortomala Lokni
  • 56,620
  • 24
  • 188
  • 240