IBM AS/400E Network Router User Manual


 
In this mode, the server will convert everything into the EBCDIC CCSID of
the job. The server checks the Entity bodies for a charset tag. If found, the
server will convert the corresponding ASCII CCSID to the EBCDIC CCSID
of the job. If the server does not find a charset tag, it uses the value of the
DefaultNetCCSID configuration directive as the conversion CCSID. In
addition, the system converts escaped octets from ASCII to EBCDIC,
eliminating the need to perform this conversion in the CGI program.
BINARY
In this mode, the server processes environment variables (except
QUERY_STRING) the same way as EBCDIC mode. The server performs no
conversions on either QUERY_STRING or stdin data.
EBCDIC_JCD
Japanese browsers can potentially send data in one of three code pages, JIS
(ISO-2022-JP), S-JIS (PC-Windows), or EUC (UNIX). In this mode, the
server uses a well-known JCD utility to determine which codepage to use
(if not explicitly specified by a charset tag) to convert stdin data.
Table 1 summarizes the type of conversion that is performed by the server for each
CGI mode.
Table 1. Conversion action for text in CGI Stdin.
CGI_MODE Conversion Stdin
encoding
Environment
variables
Query_String
encoding
argv
encoding
%%BINARY%% None No conversion FsCCSID No conversion No
conversion
%%EBCDIC%% NetCCSID to
FsCCSID
FsCCSID FsCCSID FsCCSID FsCCSID
%%EBCDIC%% - with
charset tag received
Calculate target
EBCDIC CCSID
based on received
ASCII charset tag
EBCDIC
equivalent of
received
charset
FsCCSID FsCCSID FsCCSID
%%EBCDIC_JCD%% Detect input based
on received data.
Convert data to
FsCCSID
FsCCSID FsCCSID Detect ASCII
input based on
received data.
Convert data to
FsCCSID
Detect ASCII
input based
on received
data. Convert
data to
FsCCSID
%%MIXED%%
(Compatability mode)
NetCCSID to
FsCCSID (receive
charset tag is
ignored)
FsCCSID with
ASCII escape
sequences
CCSID 37 CCSID 37 with
ASCII escape
sequences
CCSID37 with
ASCII escape
sequences
DBCS Considerations
URL-encoded forms containing DBCS data could contain ASCII octets that
represent parts of DBCS characters. The server can only convert non-encoded
character data. This means that it must un-encode the double-byte character set
(DBCS) stdin and QUERY_STRING data before performing the conversion. In
addition, it has to reassemble and re-encode the resulting EBCDIC representation
before passing it to the CGI program. Because of this extra processing, CGI
programs that you write to handle DBCS data may choose to receive the data as
BINARY and perform all conversions to streamline the entire process.
Chapter 1. Writing Common Gateway Interface Programs 7