[freetds] Testing charset

Lowden, James K LowdenJK at bernstein.com
Thu May 8 14:56:13 EDT 2003

> From: Frediano Ziglio [mailto:freddyz77 at tin.it]
> Sent: May 8, 2003 10:55 AM
> Fully agree. However current implementation never use
> TDSLOGININFO->client_charset. There are two method to build
> 1:
> a- allocate connect
> b- fill values (sometime reading freetds.conf with its client charset)
> c- call tds_fix_connect
> (used in odbc, do not involve TDSLOGININFO so no problem)
> 2:
> a- allocate connect (we pass locale to overwrite server 
> charset, and we
> initialize client_charset)
> b- get values from freetds.conf
> c- replacing with TDSLOGININFO info
> d- call tds_fix_connect
> However 2c found always a value (or from default or from freetds.conf)
> so it never replace it!!!

Ugh.  The mere existence of a function called "tds_fix_connect" is
symptomatic of a problem, if you ask me.  Every time I look at this, I
think: We need to separate reading freetds.conf from connecting to the
server.  Before we start connecting to the server, we should *know* the
options we're going to use.  All the juggling of default, environment, and
freetds.conf should be done in advance.  

> Perhaps we should initialize TDSCONNECTINFO->client_charset 
> to empty and
> set it to default on tds_fix_connect ?? This should fix the problem...

Eventually, as you know, I'd like to replace our config-file parser with my
nvp library.  In the meantime, you probably have the best knowledge of how
to fix the "2c" problem.  

> AM_ICONV is now defined in gettext (same implementation)... 
> IMHO some simple rows can fix the problem
> if test "$am_cv_func_iconv" = yes; then
> 	AC_CHECK_FUNCS(locale_charset)
> fi

That looks promising.  


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 mailing list