Skip to Content.
Sympa Menu

freetds - cs_locale and charset support

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Dmitry Petrov" <freetds AT acorn.ru>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: cs_locale and charset support
  • Date: Fri, 21 Dec 2001 16:24:54 -0500


I noticed that PHP 4.1.0 (in php_sybase_ct.c) calls cs_loc_alloc:

CS_LOCALE *tmp_locale;
...
cs_loc_alloc(ctx, &tmp_locale);
...

then sets charset:

cs_locale(ctx, CS_SET, tmp_locale, CS_SYB_CHARSET, charset, CS_NULLTERM,
NULL);

and then places this tmp_locale into connection:
...
ct_con_props(sybase->connection, CS_SET, CS_LOC_PROP, tmp_locale,
CS_UNUSED, NULL);

and finally it calls ct_connect();

in FreeTDS the first 2 functions do nothing. Can someone at least
implement support for charsets?

There is a function tds_set_charset(), but as far as I can see it is not
being called anywhere internally.

Without this support FreeTDS always uses the default "iso_1" charset.

What is probably very dangerous is that cs_loc_alloc does not even assign
anything to tmp_locale, but later its (undefined) value goes to
ct_con_props:

cs_loc_alloc(ctx, &tmp_locale);

Regards,
Dmitry



  • cs_locale and charset support, Dmitry Petrov, 12/21/2001

Archive powered by MHonArc 2.6.24.

Top of Page