Below c++ source code compiled on zOS with Codepage IBM-1047 (Compile options CONVLIT(IBM-1047) gives expected results for the Curl command.
Curl command: /home/xxx/rsusr/rocket/bin/ /curl --insecure -v -s -X POST
https://api.test-xxx.hub-xx.xx.com/xxxxservices/exec/cmd - H "Content-Type: application/json" -H
"x-api-key: xxx" -H "Authorization: Bearer xxx" -d ‘jsonbody'
Problem arises in test job (COBOL/JCL) when
Source code is c++ compiled on zOS with Codepage IBM-1141 (Compile options CONVLIT(IBM-1141).
DEBUG Curl command result: Expected valueLine: 1 Offset: 0
ERROR Failed to send V1 XE Server request
Does CURL support IBM-1141 or IBM-285? Is there any way to convert the Jsondata in the command to IBM-1047?
Hi Susan,Could you try to use the --data-binary option instead of -d?In this case, the JSON data will be send as it is.Thanks,Sergey
Thank You Sergey for the suggestion,
I tried --data-binary instead of -d , But the result is same.
IBM-1141 CONVLIT compiled chars like [ , ] in the JSON might be different which returns the Expected valueLine: 1 Offset: 0 result .
Hi Susan, in general it is a bad idea to use anything other than IBM-1047 and ISO8859-1 for source code conversion. Especially if you want to convert the same thing in both directions i.e EBCDIC -> ASCII -> EBCDIC. POSIX portable character format defines 128 Characters needed to write code and to run applications. Unfortunately 13 of those are variant! Those 13 variant characters are {}[]\^~#!|`$@ This does not seem to be a curl issue (IMHO) but lies in the nature of conversion of those 13 variant characters. Pretty good information can be found in the IBM XLC Programming guide https://www.ibm.com/docs/en/zos/3.1.0?topic=ilcs-coded-character-set-considerations-locale-functions
regards
Ronny
Thank You Ronny For the insight. Much appreciated.