Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-19990

When load parameters from a properties file which file encoding is UTF-8, parameters‘ value is not right.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins version: 1.534
      Parameterized trigger version:2.21
      Jenkins' file.encoding: UTF-8
    • Similar Issues:

      Description

      I have property file notification_params.properties, and the content is:

      MESSAGE=测试
      RECEIVERS=test123@example.com

      I use parameterized-trigger plugin to load parameters from that file and trigger my Test_Notification job. And in my Test_Notification job, I echo these parameters that passed by parameterized-trigger. I got the wrong value of $MESSAGE. But the value of $RECEIVERS is right。

      And I use enca command to check the file encoding of notification_params.properties, the result is:
      Universal transformation format 8 bits; UTF-8

        Attachments

          Issue Links

            Activity

            sfeng Song Frank created issue -
            Hide
            sogabe sogabe added a comment -

            "Parameters from properties file" can only process properties files which contain Latin-1 or Unicode-encoded characters.
            So, You have to encode your property file by using native2ascii.

            Show
            sogabe sogabe added a comment - "Parameters from properties file" can only process properties files which contain Latin-1 or Unicode-encoded characters. So, You have to encode your property file by using native2ascii.
            Hide
            lanwen Kirill Merkushev added a comment -

            From java 1.6 prop-file could be in any encoding and readed by special Reader class. Java 1.6 was released in 2006 (8 years ago). Seems that now its good time to update.

            Show
            lanwen Kirill Merkushev added a comment - From java 1.6 prop-file could be in any encoding and readed by special Reader class. Java 1.6 was released in 2006 (8 years ago). Seems that now its good time to update.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            pom.xml
            src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory.java
            src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameters.java
            src/main/java/hudson/plugins/parameterizedtrigger/ParameterizedTriggerUtils.java
            src/main/java/hudson/plugins/parameterizedtrigger/PredefinedBuildParameters.java
            src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory/config.jelly
            src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory/help-encoding.html
            src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameters/config.jelly
            src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameters/help-encoding.html
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/221df5e4ef878e4767ca4000bdb75b4b423c0421
            Log:
            JENKINS-19990 Supports property files with non-ascii characters. This feature only works properly in Java 1.6, but Java 1.5 is still supported.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: pom.xml src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory.java src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameters.java src/main/java/hudson/plugins/parameterizedtrigger/ParameterizedTriggerUtils.java src/main/java/hudson/plugins/parameterizedtrigger/PredefinedBuildParameters.java src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory/config.jelly src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory/help-encoding.html src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameters/config.jelly src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameters/help-encoding.html http://jenkins-ci.org/commit/parameterized-trigger-plugin/221df5e4ef878e4767ca4000bdb75b4b423c0421 Log: JENKINS-19990 Supports property files with non-ascii characters. This feature only works properly in Java 1.6, but Java 1.5 is still supported.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            pom.xml
            src/test/java/hudson/plugins/parameterizedtrigger/test/FileBuildParameterFactoryTest.java
            src/test/java/hudson/plugins/parameterizedtrigger/test/FileBuildTriggerConfigTest.java
            src/test/java/hudson/plugins/parameterizedtrigger/test/PredefinedPropertiesBuildTriggerConfigTest.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/e535cd745733d91b012692bdca4b5101aa0da17d
            Log:
            [FIXED JENKINS-19990] Tests for non-ascii properties.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: pom.xml src/test/java/hudson/plugins/parameterizedtrigger/test/FileBuildParameterFactoryTest.java src/test/java/hudson/plugins/parameterizedtrigger/test/FileBuildTriggerConfigTest.java src/test/java/hudson/plugins/parameterizedtrigger/test/PredefinedPropertiesBuildTriggerConfigTest.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/e535cd745733d91b012692bdca4b5101aa0da17d Log: [FIXED JENKINS-19990] Tests for non-ascii properties.
            scm_issue_link SCM/JIRA link daemon made changes -
            Field Original Value New Value
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory.java
            src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameters.java
            src/main/java/hudson/plugins/parameterizedtrigger/ParameterizedTriggerUtils.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/48063b9e0894dff47471e3e55f7b0b6a43410352
            Log:
            JENKINS-19990 Catch specific Exceptions.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory.java src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameters.java src/main/java/hudson/plugins/parameterizedtrigger/ParameterizedTriggerUtils.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/48063b9e0894dff47471e3e55f7b0b6a43410352 Log: JENKINS-19990 Catch specific Exceptions.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/parameterizedtrigger/ParameterizedTriggerUtils.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/e470582d8e4caf1e1cbb6b0ae0a509b5c50c338a
            Log:
            JENKINS-19990 LinkageError can be specified to NoSuchMethodError

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/parameterizedtrigger/ParameterizedTriggerUtils.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/e470582d8e4caf1e1cbb6b0ae0a509b5c50c338a Log: JENKINS-19990 LinkageError can be specified to NoSuchMethodError
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            pom.xml
            src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory.java
            src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameters.java
            src/main/java/hudson/plugins/parameterizedtrigger/ParameterizedTriggerUtils.java
            src/main/java/hudson/plugins/parameterizedtrigger/PredefinedBuildParameters.java
            src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory/config.jelly
            src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory/help-encoding.html
            src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameters/config.jelly
            src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameters/help-encoding.html
            src/test/java/hudson/plugins/parameterizedtrigger/test/FileBuildParameterFactoryTest.java
            src/test/java/hudson/plugins/parameterizedtrigger/test/FileBuildTriggerConfigTest.java
            src/test/java/hudson/plugins/parameterizedtrigger/test/PredefinedPropertiesBuildTriggerConfigTest.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/fea0e125f59789ea2e538b375cbcf5bcabc3bd67
            Log:
            Merge pull request #55 from ikedam/feature/JENKINS-19990_SupportNonasciiProperties

            JENKINS-19990 Support Non-ascii properties

            Compare: https://github.com/jenkinsci/parameterized-trigger-plugin/compare/4f7219e2880c...fea0e125f597

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: pom.xml src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory.java src/main/java/hudson/plugins/parameterizedtrigger/FileBuildParameters.java src/main/java/hudson/plugins/parameterizedtrigger/ParameterizedTriggerUtils.java src/main/java/hudson/plugins/parameterizedtrigger/PredefinedBuildParameters.java src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory/config.jelly src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameterFactory/help-encoding.html src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameters/config.jelly src/main/resources/hudson/plugins/parameterizedtrigger/FileBuildParameters/help-encoding.html src/test/java/hudson/plugins/parameterizedtrigger/test/FileBuildParameterFactoryTest.java src/test/java/hudson/plugins/parameterizedtrigger/test/FileBuildTriggerConfigTest.java src/test/java/hudson/plugins/parameterizedtrigger/test/PredefinedPropertiesBuildTriggerConfigTest.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/fea0e125f59789ea2e538b375cbcf5bcabc3bd67 Log: Merge pull request #55 from ikedam/feature/ JENKINS-19990 _SupportNonasciiProperties JENKINS-19990 Support Non-ascii properties Compare: https://github.com/jenkinsci/parameterized-trigger-plugin/compare/4f7219e2880c...fea0e125f597
            ikedam ikedam made changes -
            Link This issue is duplicated by JENKINS-20651 [ JENKINS-20651 ]
            Hide
            ikedam ikedam added a comment -

            Released in 2.23.

            Show
            ikedam ikedam added a comment - Released in 2.23.
            ikedam ikedam made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 151512 ] JNJira + In-Review [ 207027 ]

              People

              • Assignee:
                huybrechts huybrechts
                Reporter:
                sfeng Song Frank
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: