CGIConvMode BINARY – Help, I cannot make it working.

20 pts.
Tags:
Binary data
CGI
IBM i
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

I found it,

In putting + x’25’ + x’25 (and not + x’15’ + x’15’) at the end of the Header it works.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following