Docker Jenkins从属错误字符编码 [英] Docker Jenkins slave wrong character encoding
问题描述
我正在使用此 Jenkins从属docker映像,它基于ubuntu:14.04
I'm using this Jenkins slave docker image, it is based on ubuntu:14.04
我想使用包含UTF-8字符的字符串参数.
I would like to use a String Parameter which contains UTF-8 characters.
像öüóőúűáéí
(匈牙利字符)这样的字符将替换为question marks
The charachers like öüóőúűáéí
(Hungarian characters) will be replaced to question marks
此票证提到我试图通过-e LANG=hu_HU.UTF-8
和bash -c "locale-gen hu_HU.UTF-8"
到docker.我还将export LANG=hu_HU.UTF-8
放置在Jenkins用户的.bashrc
上,这些字符仍被替换.我也尝试过en_US.UTF-8
As this ticket mentions I tried to pass -e LANG=hu_HU.UTF-8
and bash -c "locale-gen hu_HU.UTF-8"
to docker. I also placed export LANG=hu_HU.UTF-8
to Jenkins user's .bashrc
the characters are still replaced. I also tried with en_US.UTF-8
我还尝试对詹金斯·乔布斯(Jenkins Job)做同样的事情:
I also tried to do the same with the Jenkins Job:
+ export LANG=hu_HU.UTF-8
+ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=hu_HU.UTF-8
LANGUAGE=
LC_CTYPE="hu_HU.UTF-8"
LC_NUMERIC="hu_HU.UTF-8"
LC_TIME="hu_HU.UTF-8"
LC_COLLATE="hu_HU.UTF-8"
LC_MONETARY="hu_HU.UTF-8"
LC_MESSAGES="hu_HU.UTF-8"
LC_PAPER="hu_HU.UTF-8"
LC_NAME="hu_HU.UTF-8"
LC_ADDRESS="hu_HU.UTF-8"
LC_TELEPHONE="hu_HU.UTF-8"
LC_MEASUREMENT="hu_HU.UTF-8"
LC_IDENTIFICATION="hu_HU.UTF-8"
LC_ALL=
输出是相同的.
谢谢.
推荐答案
我找到了解决方法:
bash -c "locale-gen hu_HU && locale-gen hu_HU.UTF-8 && update-locale && echo 'export LANG=hu_HU.UTF-8' > /jenkins/.bashrc"
这篇关于Docker Jenkins从属错误字符编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!