our latest z/OS system has been upgraded with Python 3.11 and IZOAU 1.2.3 and we have upgraded our ibm_zos_core collection to 1.6.0 from 1.4.0 (and even tried out the new 1.7.0-beta2) release.
Now we have encoding issues with a specific shell command. We are not sure if this is really related to the ibm_zos_core upgraded and if this is the correct place to ask for support, but as we haven’t found any other place we try doing it here:
We have the following task that is being executed on the z/OS system (managed node/target):
The file brokerhelper.xml has UTF-8 encoding on the file system and the utility brokerhelper.jar expects the file brokerhelper.xml to be in UTF-8.
The brokerelper.xml prolog contains the xml definition like this: <?xml version="1.0" encoding="UTF-8"?>
However, when the shell command is being executed the file brokerhelper.xml is being converted by ansible to EBCDIC and the brokerhelper.jar gets that xml file in ebcdic encoding. We do not want that this happens.
We have tried out the following:
we have disabled pipeling in ansible.cfg and do not set the PYTHONSTDINENCODING variable.
We have tried setting the PYTHONSTDINENCODING with pipeling and this does also not help.
We have tried out to use zos_encode and convert the already stored as UTF-8 file on the z/OS system to UTF-8 again and it does make thins even worse:
ibm.ibm_zos_core.zos_encode:
src: "/u/user/brokerhelper.xml"
encoding:
from: "UTF-8"
to: "IBM-1047"
backup: yes
Any ideas what might help?
Any help appreciated.
Thanks.
Ketan had replied to this same discussion here, maybe follow up with them.
Regarding “UTF-8 file on the z/OS system to UTF-8 again and it does make thins even worse” , going from UTF-8 to UTF-8 in that module would be a no-op, nothing would happen. The zos_encode snippet is going from UTF-8 → IBM-1047 which is what you are trying to avoid for Java.
Since I can’t know for certain if the file is actually UTF-8 , what happens when you run the command after SSH’ing in like so . /u/user/.profile && java -jar brokerhelper.jar -file /u/user/brokerhelper.xml? (without ansible)