Character encoding in dynamic scripting applications

The CICS® TS Feature Pack for Dynamic Scripting V2.0 is primarily a UTF-8 platform. The IBM® WebSphere® Application Server Liberty profile is supported only when it is running under a JVM with the UTF-8 or ISO-8859-1 character encodings.

The Dynamic Scripting Feature Pack encodes all log files in UTF-8 on z/OS® UNIX. Similarly, the PHP files are expected to be encoded in UTF-8. However, the JCICS API uses the code page that is specified in the CICS region, not the underlying JVM. The com.ibm.cics.jvmserver.local.ccsid property returns the code page that the JCICS API uses for character encoding in the JVM server. If the JCICS API is not using UTF-8 character encoding, you must manage the encoding when you transfer characters between JCICS and PHP, and if you want to pass bytes to the JCICS API, you can transcode the values by using the following code:
<?php
    java_import('com.ibm.cics.server.TSQ');
    java_import('java.lang.System');
    $jcics_encoding = System::getProperty("com.ibm.cics.jvmserver.local.ccsid");
    $tsq = new TSQ();
    $name = mb_convert_encoding('name',$jcics_encoding,'UTF-8');
    $tsq->setQueueName($name);
    $value = mb_convert_encoding('value',$jcics_encoding,'UTF-8');
    $tsq->writeItem($value);

For more information, see Data encoding.