[freetds] Unicode: Need for a DSN parameter to define the charset
James K. Lowden
jklowden at freetds.org
Fri Jan 11 13:34:25 EST 2008
Sebastien FLAESCH wrote:
> I started to look at it and it appears that many parameters are missing
> in the ODBC config, so far I have added these (using src/tds/config.c as
These we need:
These are IMO optional:
can use TDSDUMP instead
can use instance\server instead
These we don't need:
Applies only to TDS 4.2
Not a client setting, server tells us
Done automatically for many years
FYI regarding charsets. It should be the case that the client charset is
first derived from the locale(1) environment. Setting it in freetds.conf
or odbc.ini overrides that default.
> Started to hack and now I realize that it would be smarter to have the
> src/odbc/connectparams.c module USING the src/tds/config.c module
> I could also see that the ODBC code repeats the same string constants
> several times => candidate for a #define in some header file...
static const char something = "something";
> I mean, I can do a dirty/small patch or a large/smart patch ...
> Maybe I am too new to this project to make large changes, so I better
> let you guys make it nicer once posted...
>From your participation so far, I'm optimistic. Do what you think is
right. I would rather you do your best work and use your highest
judgement. The code is not sacred.
If there's some issue with your patch, we can discuss it. Normally
technical questions sort themselves out because they have more-or-less
obvious best answers.
> Also, are there any test cases I should add / adapt (I could not find
> anything in src/odbc/unittests reading an odbc.ini file)
That would be good if you can do it, particularly if all libraries use
tds/config.c. I find that the existence of a unit test increases my
ability/confidence to make a change. I can only imagine others feel the
More information about the FreeTDS