P4CHARSET is being translated to P4-{P4CHARSET} so not longer able to use Unicode enabled Perforce Servers.
Reproduction steps:
(1) Create connection to Unicode enabled P4D server.
(2) Create freestyle job.
(3) use drop down to set P4CHARSET to ShiftJis
(4) Execute the job
(5) The error is "*P4-*ShiftJIS" is an invalid character set.
Started by user anonymous
Building in workspace /var/lib/jenkins/workspace/TestP4Charset
... p4 client -o jenkins-master-TestP4Charset-0 +
... p4 info +
FATAL: P4-ShiftJIS
java.nio.charset.UnsupportedCharsetException: P4-ShiftJIS
at java.nio.charset.Charset.forName(Charset.java:531)
at com.perforce.p4java.impl.mapbased.server.Server.setCharsetName(Server.java:751)
at org.jenkinsci.plugins.p4.client.ClientHelper.clientLogin(ClientHelper.java:133)
at org.jenkinsci.plugins.p4.client.ClientHelper.<init>(ClientHelper.java:108)
at org.jenkinsci.plugins.p4.tasks.AbstractTask.getConnection(AbstractTask.java:161)
at org.jenkinsci.plugins.p4.tasks.AbstractTask.setWorkspace(AbstractTask.java:78)
at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:424)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1724)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Finished: FAILURE
Found the bug in P4Java and verified the fix in Jenkins p4-plugin. Planning to release P4Java next week along with the plugin.