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="
- I did this all on the master with the following commands:
- is related to
-
JENKINS-46902 Double Byte Order Mark - UTF8
- Closed