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

RE: Character conversion



It might be a little more helpful, Scott, if I understood which part of my
statement raised your ire.  For now I will just assume that you're objecting
to the comment about the routines being similar.  I had no basis for that
other than common source.  But it was stated as "very likely" rather than
any informed position.

If, on the other hand, you are objecting to the fact that FTPAPI doesn't
properly handle SBCS -> DBCS conversions, all I can say is that the version
I have been working with does not.  Since the only return value from the
conversion routines is negative for error / positive for success, wrong
amounts of data will be processed/written after translation.  As an example
(from the if_read procedure, free-form for clarity) :

wwRC = read(peFileDes: %addr(peBuffer): peBufLen) ;   // wwRC = bytes read
if wwrc > 0 and wkBinary = *Off ;
   toAsciiF(peBuffer: wwRC) ;             // Convert to remote CCSID
fi
return wwRC ;

Now, if toAsciiF causes a conversion from SBCS to DBCS, what do you expect
the caller of this routine will see?  It has no idea what length iconv() has
determined as appropriate after conversion.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"I find television very educating. Every time somebody turns on the set I go
into the other room and read a book."
        -- Groucho Marx 

> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-
> bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
> Sent: Monday, November 15, 2010 12:35 PM
> To: HTTPAPI and FTPAPI Projects
> Subject: Re: Character conversion
> 
> Codswallop.
> 
> On 11/15/2010 8:05 AM, Dennis Lovelady wrote:
> > Well, before you sign in to that insane asylum, I concur that your
> second
> > point looks like a problem, and may (?) be the source of the first
> issue.
> > While I haven't used HTTPAPI, and haven't seen the issue you mention,
> I did
> > see this as a potential issue in FTPAPI, and am working to correct it.
> Very
> > likely the routines look very similar to one another.  (Or did.)
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------