[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTPAPI - character set utf-8



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


1) When I build the SOAP package, do I still need to convert this to
UTF-8 (ccsid of 1208)?

Depends on how you're calling HTTPAPI. Normally, HTTPAPI translates data from your job's CCSID to US-ASCII (CCSID 367) because that's the standard for the HTTP protocol.


If you think about it, that's not really correct behavior. Yes, the HTTP protocol is US-ASCII, so all of the HTTP keywords need to be in that CCSID, but the data that you upload isn't a part of that, so that data should NOT be encoded that way.

In fact, originally, HTTPAPI didn't encode the data you uploaded. But this confused the heck out of people because the web server didn't expect to be receiving EBCDIC data, and it seemed like a lot of extra work to manually re-encode everything before sending it.

So, HTTPAPI was changed to encode the POST data along with everything else. However, there are three exceptions to this rule:

   http_url_post_raw2()
   http_url_post_stmf()
   http_url_post_stmf_xml()

These 3 APIs do not change the data that you upload at all. So if you want to upload data that's in CCSID 1208, it'd be relatively easy to use these to do it.

Use the IFS APIs to write your data to a stream file. The IFS APIs can automatically translate to 1208 when the data is written. You can then use http_url_post_stmf() to send the document to the server.

CCSID 1208 should be no problem at all on the receiving side.

2) Here's the SOAP package, does it need a CRLF (const(x'od25)) at the
end of each line?

It doesn't matter if there's a CRLF. In XML, that CRLF is ignored. It's nice to have it because it's easier for a human being to read the data when it's broken into lines, but it's not required.


FWIW, I didn't see ANYTHING in that document that would require you to send UTF-8 data. So I don't see why it's important to get UTF-8 working.

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------