× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Hi All,

I have recently been doing RPG CGI development on the Integrated Application Server (Apache) on a 6.1 machine. The server instance is running in EBCDIC mode and EBCDIC output mode (the default).

I have an issue when working with XML output: There are two MIME types I can set as the content type for XML in the HTTP header: text/xml or application/xml.

If I specify the content type to be text/xml in the HTTP header the server takes my EBCDIC output and translates it to ASCII and sends it to the client (as you would expect with text). If I specify the content type to be application/xml the text translation is NOT performed and junk (a stream of EBCDIC octets) is sent to the client.

The thing is: application/xml is the recommended content type for XML. The optional charset attribute should indicate the encoding (and therefore drive translation), but setting this does not appear to instruct the server to translate the encoding. This doesn't seem correct.

Other software out there must encounter this issue. I see MMAIL lets you specify whether the attachment is binary or not so I guess MMAIL circumvents the translation issue by delegating the 'text or binary' decision to the developer. I wonder if CGIDEV2 has some code in place for this or maybe it just specifies text/xml and neatly avoids the issue.

I know I could just set the content type to text/xml and I'm sure everything would be fine, but it doesn't seem correct. I have placed a (probably necessary) workaround in the code to inspect the HTTP Content-Type header and
translate to the appropriate encoding for application/xml output prior
to writing the content to standard output, but I am very interested to see if anybody else has
encountered this issue before?


Cheers

Larry Ducie



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.