freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] hard-coded UCS-2 strings and the C standard
- From: "James K. Lowden" <jklowden AT freetds.org>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] hard-coded UCS-2 strings and the C standard
- Date: Mon, 13 Jun 2005 21:45:03 -0400
ZIGLIO, Frediano, VF-IT wrote:
> tds_put_string should work too but it expect client encoding... another
> solution is to separate code to handle iso -> ucs2 conversion. It seems
> that iso2server_metadata conversion is used only to do this conversion,
> perhaps a tds_iso2ucs2le would eliminate the need for this conversion
> too
The advantage of using our iconv system for iso -> ucs2 is that it's
independent of the stack: you can convert any size column data, including
2GB text.
> perhaps a define like
>
> #define TDS_PUT_AS_UCS2(tds, s) do { \
> char buffer[sizeof(s)*2-2]; \
> tds_put_n(tds, buffer, tds_iso2ucs2le(buffer, s)); \
> } while(0)
I think that's not portable. ISTR compilers that don't like arrays based
on sizeof(). Didn't Bill have one?
It looks like your solution and mine are about the same in terms of code
size. I think mine's a little easier to understand. OK to commit?
I'm glad we agree the hard-coded strings are, um, ugly. :-)
Regards,
--jkl
-
[freetds] hard-coded UCS-2 strings and the C standard,
Lowden, James K, 06/10/2005
-
Re: [freetds] hard-coded UCS-2 strings and the C standard,
Frediano Ziglio, 06/11/2005
-
Re: [freetds] hard-coded UCS-2 strings and the C standard,
James K. Lowden, 06/11/2005
- Re: [freetds] hard-coded UCS-2 strings and the C standard, Brian Bruns, 06/11/2005
-
Re: [freetds] hard-coded UCS-2 strings and the C standard,
James K. Lowden, 06/11/2005
- <Possible follow-up(s)>
- RE: [freetds] hard-coded UCS-2 strings and the C standard, ZIGLIO, Frediano, VF-IT, 06/13/2005
-
RE: [freetds] hard-coded UCS-2 strings and the C standard,
ZIGLIO, Frediano, VF-IT, 06/13/2005
- Re: [freetds] hard-coded UCS-2 strings and the C standard, James K. Lowden, 06/13/2005
-
RE: [freetds] hard-coded UCS-2 strings and the C standard,
ZIGLIO, Frediano, VF-IT, 06/14/2005
-
[freetds] Connection issue,
Chris parent, 06/14/2005
-
[freetds] Re: Connection issue,
Daniel Fazekas, 06/14/2005
-
Re: [freetds] Re: Connection issue,
Chris parent, 06/14/2005
-
Re: [freetds] Re: Connection issue,
Daniel Fazekas, 06/14/2005
- Re: [freetds] Re: Connection issue, Chris parent, 06/14/2005
-
Re: [freetds] Re: Connection issue,
Daniel Fazekas, 06/14/2005
-
Re: [freetds] Re: Connection issue,
Chris parent, 06/14/2005
-
[freetds] Re: Connection issue,
Daniel Fazekas, 06/14/2005
- Re: [freetds] hard-coded UCS-2 strings and the C standard, James K. Lowden, 06/14/2005
-
[freetds] Connection issue,
Chris parent, 06/14/2005
-
Re: [freetds] hard-coded UCS-2 strings and the C standard,
Frediano Ziglio, 06/11/2005
Archive powered by MHonArc 2.6.24.