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

P4 plugin removed BOM from utf8 files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • CloudBees Jenkins Enterprise 2.89.1.7-rolling
      P4 Plugin version: 1.80
      OS: happens on both windows 10+ and Centos

      Since version 1.80, the P4 Plugin removes the BOM from all UTF8 files when syncing. Without the BOM files may be incorrectly decoded. This behaviour does not mirror the behaviour of P4.EXE (2015.2 onwards). Furthermore, you are not able to use '-Dcom.perforce.p4java.filesys.utf8bom=1` as a work around (I believe this is because the value is now hardcoded: https://swarm.workshop.perforce.com/changes/23042). I personally would always want the default behaviour of the P4 Plugin to match the default behaviour of P4.exe.

      Repo Steps:

      • Create UTF8 file with UTF8 characters
      • Submit that file to perforce (ensuring its type is utf8)
      • Make sure you have the P4 plugin installed, version 1.8.0 or later
      • Create a job to sync the file
      • Install P4 and compare 
        • I did this all on the master with the following commands: 

          head -c 50 /var/lib/jenkins/workspace/TestJob/test_utf8.ps1 | hexdump -C

          p4 -p <server> -u <user> print -o ~/test/test_utf8.ps1 //CM/DREUK/Prod/Scripts/Config/Windows/test_utf8.ps1head -c 50 ~/test/test_utf8.ps1 | hexdump -C

          p4 -V | grep "Rev"

          cat /etc/sysconfig/jenkins | grep "JENKINS_JAVA_OPTIONS="

        1. Opened_in_HxD_on_Windows_using_p4_exe.png
          Opened_in_HxD_on_Windows_using_p4_exe.png
          6 kB
        2. P4_1.7.7.png
          P4_1.7.7.png
          24 kB
        3. P4_1.8.0.png
          P4_1.8.0.png
          29 kB
        4. P4_1.8.3.png
          P4_1.8.3.png
          23 kB
        5. test.ps1
          0.1 kB

            p4paul Paul Allen
            peanderson peter anderson
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: