[freetds] detecting iconv names
Lowden, James K
LowdenJK at bernstein.com
Fri May 2 16:59:21 EDT 2003
> From: Mark J. Lilback [mailto:mark at lilback.com]
> Sent: May 2, 2003 4:19 PM
> >So, a script like
> > OUT=`echo foo | iconv -f iso88591 -t ucs2 | cksum | cut
> -d ' ' -f 1`
> >is portable !!!
> >I must check results cause some iconv put bytes in front of ucs2 if
> >no endian specified...
> Is this for building, or testing?
I thought Frediano was working up some unit tests, but now that you mention
it, it does look like something for configure.in. Perhaps he's trying to
discover by trial-and-error the names of some common character sets.
> Non-GNU implementations likely
> won't have an iconv program. My mac implementation won't.
Many less-than-Mac systems -- Solaris, Tru64, VMS, HP/UX, IRIS -- include
iconv(3). They might or might not accept some of the names that GNU's does.
> As long as I can force it with an argument to configure.
I don't expect you to throw a switch; I expect configure to do its job
without your help:
test for locale_charset()
if true, GNU iconv
test for iconv() # as today
if true, HAVE_ICONV is true
else HAVE_ICONV is false
If you have iconv installed on your system and don't want FreeTDS to use it,
If HAVE_ICONV is false, we never call on iconv and never have to worry about
charset names. If it's true, Frediano would like to support the OS's
charset names (or so it seems to me). I would like to support GNU iconv on
non-GNU system, which is the purpose of the first test.
OS X has a completely different way to do this. As I understood you, you're
going to have a Mac implementation of tds_iconv, and Mac-specific code for
initializing TDS_ICONVINFO. That will be the Win32 approach too, I should
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.
More information about the FreeTDS