In the CGI, I use iconv() to translate all input/output from ebcdic to utf-8 (ccsid 1208) and vice versa for the body.
For the CGI output Header I don't process any translation, add x'15 twice to make a blank line.
(as the HTTP default should make the translation from 37 to 819 for the http header)
The CGI env. var are:
CGI_ASCII_CCSID = 819
CGI_EBCDIC_CCSID = 37
CGI_OUTPUT_MODE = BINARY
The Header is:
Content-Type: text/xml; charset=UTF-8 + x'15' + x'15' +x'00';
I always get the HTTP error:
ZSRV_MSG0108: Header from script is not valid. Bad header is Ö `
z@ a <HTML>blabla</HTML>: File name is
/qsys.lib/testlib.lib/testGet.pgm
(Kind of weird as I would have expected to see the readable part of the
"bad header" being the initial part and see the second part
<HTML>blabla</HTML> with uncoded char as they are in utf-8)
???
The same CGI-pgm without using the iconv() and without the CGIConvMode BINARY in the httpd.conf works fine.
But I cannot make it working with it and I don't see what I am missing.
Does anyone have experiences with CGIConvMode BINARY ?
Software/Hardware used:
IBM i, v6, HTTP, CGI
ASKED:
Sep 21, 2011 11:21 AM GMT
UPDATED:
March 31, 2012 3:48:13 PM GMT