Hi, I have some trouble moving curl for z/OS from version 7.16.1 to 7.52.1.
We call curl from a program written in REXX (using bpxbatch routine) to call a websevice on a remote (non z/OS) server; this webservice returns data already encoded in EBCDIC.
Using the old version the data is retrieved with the correct encoding, while the new version shows bad encoded data; I obtain the same behaviour even if I call curl from ISHELL or BPXBATCH.
Please note that we need to get the data from the stdout without writing it to a unix file (If I use the -o option to write to a unix file the data is written with the correct encoding).
This is what happens with curl for z/OS version 7.16.1:
curl -v --header “Xml-Stylesheet:/xsl/tws-ws2zos.xsl” --user “***:***” “http://***”
- HPUC0330 About to connect() to *** port 80 (#0)
- HPUC0016 Trying ...… HPUC0017 connected
- HPUC0331 Connected to *** (...) port 80
- HPUC0143 Server auth using Basic with user ‘***’
GET *** HTTP/1.1.
Authorization: Basic ***
User-Agent: curl/7.16.1.
Host: ***
Accept: /.
Xml-Stylesheet:/xsl/tws-ws2zos.xsl.
.
-
HPUC0302 Pre readwrite setting chunky header values to default
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
. 0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0.
< Date: Wed, 18 Jul 2018 08:14:58 GMT.
< Server: Apache.
< Cache-Control: no-cache.
< Content-Length: 31.
< Keep-Alive: timeout=2, max=100.
< Set-Cookie: JSESSIONID=***
< Set-Cookie: JSESSIONID=***
< Content-Type: application/xml.
{ [data not shown]
. 0 31 0 31 0 0 3 0 --:–:-- 0:00:09 --:–:-- 6.
-
HPUC0320 Closing connection #0
ORCS0, 3, X, BATCH, $42A, FP01
The last line shows the output data displayed with the correct encoding.
This is what happens with curl for z/OS version 7.52.1:
curl -v --header “Xml-Stylesheet:/xsl/tws-ws2zos.xsl” --user “***:***” “http://***”
- Trying ...…
- TCP_NODELAY set
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
. 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0*
- Server auth using Basic with user ‘***’
GET *** HTTP/1.1.
Host: ***
Authorization: Basic ***
User-Agent: curl/7.52.1.
Accept: /.
Xml-Stylesheet:/xsl/tws-ws2zos.xsl.
.
. 0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0.
< Date: Wed, 18 Jul 2018 08:19:14 GMT.
< Server: Apache.
< Cache-Control: no-cache.
< Content-Length: 31.
< Keep-Alive: timeout=2, max=100.
< Set-Cookie: JSESSIONID=***
< Set-Cookie: JSESSIONID=***
< Content-Type: application/xml.
< .
{ [31 bytes data]
- Curl_http_done: called premature == 0
.100 31 100 31 0 0 5 0 0:00:06 0:00:05 0:00:01 7
- Connection #0 to host *** left intact
ÖÙÃâðk@ók@çk@ÂÁãÃÈk@[ôòÁk@Æ×ðñ.
The data is shown with the bad encoding.
I have tried several combinations of curl parameters (–raw, -B, --zos-output, and some env vars) without success.
The only ways that I have found to get the correct output are:
- using the -o parameter to write the output to a unix file;
- pipe the stdout to the command “iconv -f IBM-1047 -t ISO8859-1”
Is there any way to get curl work as the previous version?
As additional information, this is the same command called from my Windows pc:
curl -v --header “Xml-Stylesheet:/xsl/tws-ws2zos.xsl” --user “***:***” “http://***”
- Trying ...…
- Connected to *** (...) port 80 (#0)
- Server auth using Basic with user ‘***’
GET *** HTTP/1.1
Host: ***
Authorization: Basic ***
User-Agent: curl/7.50.0
Accept: /
Xml-Stylesheet:/xsl/tws-ws2zos.xsl
< HTTP/1.1 200 OK
< Date: Wed, 18 Jul 2018 08:00:23 GMT
< Server: Apache
< Cache-Control: no-cache
< Content-Length: 31
< Keep-Alive: timeout=2, max=100
< Set-Cookie: JSESSIONID=***; path=/; HttpOnly
< Set-Cookie: JSESSIONID=**; path=/; HttpOnly
< Content-Type: application/xml
<
Í┘├Ôk@¾k@þk@┬┴Ò├╚k@[¶‗┴k@ãα Connection #0 to host *** left intact
Thanks in advance.
Daniele