[freetds] How to set tsql's client character set

KJ kjatwork at gmx.net
Mon Aug 14 11:23:51 EDT 2006

Hello James,

thanks for your answer. I realized that I went through the wrong thread (Charset question instead of Charset selection). 

> KJ, 
> http://manuals.sybase.com/onlinebooks/group-cnarc/cng1110e/dblib/@ebt-li
> nk;pt=9760?target=%25N%15_37138_START_RESTART_N%25

The section describes exactly how sybase's isql and bcp option -J is implemented on the API level.

> While I agree that implementing Sybase's charset control options would
> be useful (particularly for bcp), I also think it's a distraction.
> Fundamentally, we have to pass the correct client charset in the TDS 5.0
> login record.  We're really just talking about how the default is
> determined.  We want to use the following order:
> 1.  programmatic setting (-J, DBSETLCHARSET)
> 2.  freetds.conf
> 3.  locale
> IOW, if the application sets the charset, we ignore freetds.conf, else
> we look in freetds.conf.  If it's not set there, we rely on the locale.
> That way, for a correctly configured machine --  i.e. one that can
> display characters in the charset indicated by the locale -- everything
> Just Works.  For some applications, say a server that itself is ISO
> 8859-1 but generates HTML documents in UTF-8, the freetds.conf override
> is handy.  

I'd agree in that order.
Just to be sure: if condition 1 is true the other steps are skipped.

> I don't want to waste your time.  I suggest you either apply Steve's
> patch to try to roll your own, such that the locale doesn't override
> your freetds.conf setting.  Then I think you'll be home free.  
> Regards, 
> --jkl

You mentioned Steve's patch. How do I get it? I just downloaded the latest nightly build, but the behaviour I described in my first mail is still the same (freetds.conf doesn't override system's locale). Hence the patch is not (yet) included?

I don't want to build my own freetds. I'd rather prefer to reply on the common version.


PS: How it's possible to search the Mailing List?

Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

More information about the FreeTDS mailing list