-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
jenkins 2.249.3
jdk8
ubuntu
pipeline-utility-steps 2.6.2
I readProperties from file, but some value is garbled, seem not encoding. Looks like this “é±ä¹å¹³”
I try readFile it can work well.Especially the properties file contains Chinese characters 。
so i workaround like this
def gerritcfg = readFile file:filename def props = readProperties text:gerritcfg println props
here another test pipeline code:
node {
filename= "pipeline-utility-steps-plugin/work/test.properties"
def properties = readFile file:filename
def props1 = readProperties text:properties
def props2 = readProperties file:filename
println props1
println props2
}
$ file test.properties test.properties: UTF-8 Unicode text the properties file looks like below: $ cat test.properties prop1=abcabc123 prop2=中国中国
the pipeline console output.
Started by user unknown or anonymous
Replayed #8
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on Jenkins in /work/brightma/github/pipeline-utility-steps-plugin/work/workspace/test_pipe
[Pipeline] {
[Pipeline] readFile
[Pipeline] readProperties
[Pipeline] readProperties
[Pipeline] echo
{prop2=中国中国, prop1=abcabc123}
[Pipeline] echo
{prop2=ä¸å½ä¸å½, prop1=abcabc123}
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS