freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Lowden, James K" <LowdenJK AT bernstein.com>
- To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
- Subject: RE: Losing last character of TEXT fields
- Date: Tue, 9 Jul 2002 15:55:58 -0400
> From: Eric Deutsch [mailto:edeutsch AT systemsbiology.org]
> Sent: July 9, 2002 1:43 PM
>
> case SYBTEXT:
> case SYBCHAR:
> case SYBBINARY:
> cplen = srclen > destlen ? destlen : srclen;
> memcpy(dest, src, cplen);
> return cplen;
Eric,
Your remarks are on the money. Please ignore my last message. I now like
your "radical" solution best, because it's both simple and funny.
I should have looked at cs.c, at cs_convert(). I was fixing dblib in
tdslib, with the consequence of breaking ctlib. The weird termination
behavior described in the dblib docs shouldn't be embedded in a shared
library. dbconvert() is what needs attention.
Brian, I'd like to suggest a policy about conversions for the project; if
you like it then it should be explicitly noted somewhere.
<policy>
tds_convert copies from src to dest and returns the output data length,
period. All padding and termination is the responsibilty of the API library
and is done post conversion. There may be some shared utility padding &
termination functions, but they're really not "conversion". Trying to do
anything nonstraightforward in tds_convert will only confuse and confound
the higher levels, us among them.
</policy>
An alternative would be to pass the padding & termination policy argument as
an enumerated type, which tds_convert would carry out if the basic
conversion succeeds.
You have more experience with this (obviously), and have some idea where
UTF-8 is taking us, so I'm curious how you see things.
--jkl
-
RE: Losing last character of TEXT fields
, (continued)
- RE: Losing last character of TEXT fields, Lowden, James K, 07/09/2002
- RE: Losing last character of TEXT fields, Bill Thompson, 07/09/2002
- RE: Losing last character of TEXT fields, Brian Bruns, 07/09/2002
- RE: Losing last character of TEXT fields, Lowden, James K, 07/09/2002
- RE: Losing last character of TEXT fields, Eric Deutsch, 07/09/2002
- RE: Losing last character of TEXT fields, Brian Bruns, 07/09/2002
- RE: Losing last character of TEXT fields, Eric Deutsch, 07/09/2002
- RE: Losing last character of TEXT fields, Michael Peppler, 07/09/2002
- RE: Losing last character of TEXT fields, Lowden, James K, 07/09/2002
- RE: Losing last character of TEXT fields, Eric Deutsch, 07/09/2002
- RE: Losing last character of TEXT fields, Lowden, James K, 07/09/2002
- RE: Losing last character of TEXT fields, Eric Deutsch, 07/09/2002
- RE: Losing last character of TEXT fields, Brian Bruns, 07/09/2002
- RE: Losing last character of TEXT fields, ZIGLIO Frediano, 07/10/2002
- RE: Losing last character of TEXT fields, Bill Thompson, 07/10/2002
- RE: Losing last character of TEXT fields, ZIGLIO Frediano, 07/10/2002
- RE: Losing last character of TEXT fields, Thompson, Bill D (London), 07/10/2002
- RE: Losing last character of TEXT fields, Brian Bruns, 07/10/2002
- RE: Losing last character of TEXT fields, Thompson, Bill D (London), 07/10/2002
- RE: Losing last character of TEXT fields, Brian Bruns, 07/10/2002
- RE: Losing last character of TEXT fields, James K . Lowden, 07/10/2002
Archive powered by MHonArc 2.6.24.