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

JobConfigHistory-Plugin modifies UTF-8 characters within jobs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • None
    • Jenkins LTS 2.222.4 on Windows Server 2019
      Adopt Open JRE 1.8.0_252-b09 with UTF-8 (file.encoding and sun.jnu.encoding)

      I just found out that the plugin changes characters within config.xml of jobs.

      This took me some time to find out why valid jobs running on other Jenkins instances without any problems crashed. The diffrence were that on this instance the JobConfigHistory-Plugin was installed.

      It's also not immediately apparent in the Jenkins UI that the jobs have been changed because they are cached.

      But after a restart of Jenkins the UI shows the changed characters.

       

      Steps to reproduce the problem:

      Create a new Job (or use a alread existing) with UTF-8 chars inside and save it with this plugin enabled.

      Example:

      Job config.xml without JobConfigHistory-plugin installed:
            (Jira dont let me save this issue with utf-8 chars inside so // // is were the chars are)

      ...
      <builders>
       <hudson.tasks.BatchFile>
       <command> //_Emoji that are often used for logs//_
      ―― //_UTF-8 FAT CHARS//_ ――</command>
       </hudson.tasks.BatchFile>
       </builders>
      ...
      

       

      The same Jobs config.xml after saving with JobConfigHistory installed:

      ...
      <builders>
       <hudson.tasks.BatchFile>
       <command>&#128077;&#13;
      ―― &#119827;&#119812;&#119826;&#119827;: &#119816;&#119821;&#119826;&#119827;&#119808;&#119819;&#119819;&#119812;&#119825; ――</command>
       </hudson.tasks.BatchFile>
       </builders>
      ...
      

       

      All chars are transformed to HTML representation( &#"UTF-8-Number"; ), but config.xml are UTF-8 encoded, so this will change the characters to something with different meaning.

            stefanbrausch Stefan Brausch
            martinbauer Martin Bauer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: