Skip to Content.
Sympa Menu

freetds - Re: [freetds] Unicode: Need for a DSN parameter to define the charset

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Unicode: Need for a DSN parameter to define the charset
  • Date: Fri, 11 Jan 2008 13:34:25 -0500

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
> ref):
>

These we need:

> ClientCharset
> ConnectionTimeout
> DebugFlags
> Encryption
> QueryTimeout

These are IMO optional:

> DumpFile
can use TDSDUMP instead
> Instance
can use instance\server instead

These we don't need:

> EmulateLittleEndian
Applies only to TDS 4.2
> ServerCharset
Not a client setting, server tells us
> SwapBrokenDates
> SwapBrokenMoney
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

Absolutely!

> I could also see that the ODBC code repeats the same string constants
> several times => candidate for a #define in some header file...

Yes, or

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
same way.

Regards,

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page