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

Re: PostDataLen Question



Hi Dan,

 > If I have the post data in the IFS with CCSID 437 the Webservice acts
 > as expected.
 >
 > I'm trying to use HTTPAPIs to provide the same response.
 >
 > I've tried multiple varieties of the http_SetCCSIDs...1208:0 was the
 > example I started with and wondered if you had any suggestions on how
 > this could be used???


Yes, I explained this in the message I sent to you previously.  HTTPAPI 
does not change the value of pePostDataLen even when it *SHOULD*. 
That's the problem that you're seeing.

UTF-8 (CCSID 1208) is a mixed-byte encoding.  Some characters take up 1 
byte in UTF-8, others take up 2 bytes.  Still others take up 3 or 4 
bytes.  Some can be as long as 6 bytes to represent a single character!

So when you convert a single-byte character set (such as US-EBCDIC) to 
UTF-8, the length of the data becomes longer, and therefore the 
content-length should also change.  The problem is, it's not changing in 
HTTPAPI!  The content-length is actually sent before the data has been 
translated, so HTTPAPI is sending the length of the data in EBCDIC 
instead of the length in UTF-8.

So the problem is actually the opposite of what you described.  You said 
that pePostDataLen was changing, when in reality, it's NOT changing even 
when the physical size of the data changes, and that's the cause of the 
problem.

I've made some changes to the way HTTPAPI works that should fix this 
problem.  I've created a new BETA version of HTTPAPI (1.18pre5) with the 
updated code.

Please help me test this updated version.

SAVF: http://www.scottklement.com/httpapi/beta/httpapi.savf
XML:  http://www.scottklement.com/httpapi/beta/httpapi.xml
ZIP:  http://www.scottklement.com/httpapi/beta/httpapi.zip
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------