Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How set encodings in Jenkins to UTF-8

Cyrillic symbols in the Console output are not displayed correctly. Jenkins is running through Tomcat / 8.5.11 on Windows 7
The Jenkins property displays:
file.encoding Cp1251
sun.jnu.encoding Cp1251
sun.stderr.encoding cp866
sun.stdout.encoding cp866

How can I set the encoding on UTF-8 in Jenkins? Encoding in autotest code is UTF-8.
It is example problem in Cyrillic text
_максимум_информации

like image 271
Denis Bolshakov Avatar asked Sep 08 '17 08:09

Denis Bolshakov


People also ask

How do I change my UTF-8 character set?

Click Tools, then select Web options. Go to the Encoding tab. In the dropdown for Save this document as: choose Unicode (UTF-8). Click Ok.

Can ASCII characters be encoded UTF-8?

UTF-16 binary encoding Recall that UTF-8 encodes each ASCII character in just one byte. UTF-16 must encode these same characters in either two or four bytes. This means that an English text file encoded with UTF-16 would be at least double the size of the same file encoded with UTF-8.

Is UTF-8 the default encoding?

UTF-8 is the dominant encoding for the World Wide Web (and internet technologies), accounting for 98.0% of all web pages, and up to 100.0% for many languages, as of 2022.

Is UTF-8 character set or encoding?

UTF-8 is a character encoding system. It lets you represent characters as ASCII text, while still allowing for international characters, such as Chinese characters. As of the mid 2020s, UTF-8 is one of the most popular encoding systems.


2 Answers

According to this answer: JVM property -Dfile.encoding=UTF8 or UTF-8?

You have to add this JVM setting to your Jenkins starting script (JAVA_TOOLS_OPTIONS):

-Dfile.encoding=UTF8
like image 99
Bruno Lavit Avatar answered Oct 10 '22 18:10

Bruno Lavit


I created file setenv.bat in bin folder and set JAVA_OPTS="-Dfile.encoding=UTF-8"

like image 3
Denis Bolshakov Avatar answered Oct 10 '22 16:10

Denis Bolshakov