Code page conversion for CICS as an HTTP client

When CICS® as an HTTP client exchanges messages with a server, code page conversion is normally required for the message bodies. You specify an application code page when opening the connection. The character sets can usually be identified by CICS or allowed to default.

Request line and HTTP headers

Code page conversion for a request line or status line and for HTTP headers is handled as follows:
  • When CICS is preparing to send out a request, the request line and HTTP headers may be generated by CICS, or specified by the application using the WEB WRITE HTTPHEADER command. Before sending, all the headers are converted from the EBCDIC code page in which they were specified, into the US-ASCII character set.
  • Soon after receiving a response, CICS converts the status line and HTTP headers from the US-ASCII character set, into the EBCDIC code page 037. The application receives the status line and other information, and examines the HTTP headers, in their converted form, in the EBCDIC code page 037.

Message bodies

Code page conversion for the message bodies is handled as follows:
  • The EBCDIC code page used by the application program is specified on the WEB OPEN command that initiates communication with the server. The default is the EBCDIC code page specified by the LOCALCCSID system initialization parameter (which applies to the whole of the local CICS region, and has a default of 037). CICS uses this information for converting the message bodies for requests and responses on this connection.
  • For each request that the application sends out, the CLIENTCONV option on the WEB SEND or WEB CONVERSE command specifies whether or not CICS carries out code page conversion for the request body. The default is that code page conversion does take place. If you are using the WEB CONVERSE command, you can choose to specify code page conversion for either, both, or neither of the request body and the response body.
  • If you have specified conversion for a request, the default is that CICS converts the request body to the ISO-8859-1 character set. You can use the CHARACTERSET option on the WEB SEND or WEB CONVERSE command to select an alternative, if you know that the server prefers a different character set.
  • For each response that the application receives, the CLIENTCONV option on the WEB RECEIVE or WEB CONVERSE command specifies whether or not CICS carries out code page conversion for the response body, into the EBCDIC code page specified when the connection was opened. The default is that code page conversion does take place. CICS examines the response headers to identify the character set that the server used for the response body. If the response headers do not provide this information, or the named character set is unsupported, CICS assumes as a default that the message body is in the ISO-8859-1 character set.