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
(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 ?
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!