Skip to Content.
Sympa Menu

freetds - RE: [freetds] RE: latest snapshot testing on Sun Solaris

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] RE: latest snapshot testing on Sun Solaris
  • Date: Wed, 25 Jun 2003 11:43:04 -0400

> From: Thompson, Bill D (London) [mailto:ThompBil AT exchange.uk.ml.com]
> Sent: June 25, 2003 7:56 AM
>
> I discovered that my iconv() would convert ISO-8859 to UTF-8 (despite
> circumstantial evidence to the contrary), so I did this and
> got past that
> stage. However I then fell over on the ISO-8859 / UCS-2
> conversions. My
> iconv was having none of that.

I'd look once more, Bill. It seems very unlikely to me that it would
support UTF-8 and not UCS-2, because UCS-2 was the first of the Unicode
standards. It might be called UCS-2LE or something more peculiar. I can't
see how a UTF-8 conversion could be accomplished without full knowledge of
UCS-2. (After all, UTF-8 is a multibyte "transitional" representation of
UCS-4 values.)

> If I code a replacements/iconv.c , will it have to replace my
> existing iconv in all cases ?

Yes.

> If so, will I also have to cater for other conversions - like the
> 8859->ASCII and the 8859->UTF-8 ?

No. replacements/iconv.c will enable FreeTDS to do only what it used to do
without iconv: add a zero high byte to create UCS-2, and strip the high byte
to create ISO-8859-1. It also has to support the trivial pass-through case,
because in some cases we expect iconv to copy the buffer even when it's not
strictly necessary (think tdsconvert).

> Any Idea what an iconv_t is ?

$ grep iconv_t /usr/pkg/include/i*.h |egrep 'type|def' |tail -1

typedef void* iconv_t;

> or at least some ideas about what I'll need to put in my own
> version of it ?

I think you'll need

#if !HAVE_ICONV
typedef void* iconv_t;
#endif

in tds.h.

Another thought, Bill: Maybe you could rip the minimum code right out of
GNU iconv. Use their headers, their handle generation/lookup method, etc.
Probably replace just the conversion algorithm. They're LGPL, too, same as
we use.

--jkl
-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page