Skip to Content.
Sympa Menu

freetds - Re: [freetds] How to set tsql's client character set

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "KJ" <kjatwork AT gmx.net>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] How to set tsql's client character set
  • Date: Thu, 10 Aug 2006 16:52:14 +0200

Fortunately, the code has been compiled with debug information.
So I debugged into the code and found the corresponding part:

it's in file config.c line 485 (function tds_config_login).

485 if (!tds_dstr_isempty(&login->client_charset)) {
486 tds_dstr_copy(&connection->client_charset,
tds_dstr_cstr(&login->client_charset));
487 tdsdump_log(TDS_DBG_INFO1, "tds_config_login: %s is
%s.\n", "client_charset",
488 tds_dstr_cstr(&connection->client_charset));
489 }

The point is, that connection->client_charset is "ISO-8859-1" - resulting
from conf file, while login->client_charset is set to result of
nl_langinfo(CODESET), which returns USASCII.
Hence it always will be USASCII, no matter which value is being specified in
the config file.

May be the login structure should be filled from the config file?!


-------- Original-Nachricht --------
Datum: Wed, 9 Aug 2006 13:51:07 -0400
Von: "Lowden, James K" <james.k.lowden AT alliancebernstein.com>
An: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
Betreff: Re: [freetds] How to set tsql\'s client character set

> > From: KJ
> > Sent: Wednesday, August 09, 2006 5:45 AM
> >
> > I just successfully compiled and installed freetds 0.64 on cygwin.
> > I'm able to get a connection to Sybase ASE as well as to MS SQL
> > Server. However I can't figure out how to tell the client (e.g.
> > tsql) to use use a specific character set. Sybase ASE's character
> > set is iso_1 and I tried to connect to Sybase using differnet
> > character set specifications, e.g ISO-8859-1, iso_1. But no matter
> > which character set I'm specifying, tsql always connects with
> > iso646. As far as I can see, I compiled tsql with the GNU iconv
> > library. Hence all the supported character set conversion should
> > be available. Does someone know how to specify the character set?
> >
> > TIA KJ
> >
> > tsql -C provides
> >
> > Compile-time settings (established with the "configure" script):
> > Version: freetds v0.64
> > MS db-lib source compatibility: no
> > Sybase binary compatibility: unknown
> > Thread safety: yes
> > iconv library: yes
> > TDS version: 5.0
> > iODBC: no
> > unixodbc: no
> >
> > Running tsql I get
> >
> > locale is "C" locale charset is "US-ASCII" Password: Msg 2401,
> > Level 11, State 2, Server ASE125, Line 0 Character set conversion
> > is not available between client character set 'iso646' and server
> > character set 'iso_1'.
>
> Hrm. Thank you for the problem report. You've done everything right.
> Somehow, the "client charset" is being ignored in favor of the locale
> setting. I don't know why that's happening. I hope it's specific to
> Cygwin & TDS 5.0.
>
> BTW, iconv doesn't normally get involved with Sybase servers. When the
> client connects to a Sybase server, it indiciates its preferred
> encoding, which the server typically supports. When the data arrive at
> the client, iconv has nothing to do because the apparent "server
> charset" is identical to the client's. (That's why you get message 2401
> >from the server: it can't convert an 8-bit encoding to a 7-bit one.)
>
> Please try setting the locale (probably the LANG or LC_ALL, but see your
> manual) to ISO 8859-1 and see if that helps.
>
> HTH.
>
> --jkl
>
> -----------------------------------------
> The information contained in this transmission may be privileged and
> confidential 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. If you, as the intended
> recipient
> of this message, the purpose of which is to inform and update our clients,
> prospects
> and consultants of developments relating to our services and products,
> would not
> like to receive further e-mail correspondence from the sender, please
> "reply" to the
> sender indicating your wishes. In the U.S.: 1345 Avenue of the Americas,
> New York,
> NY 10105.
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds

--


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




Archive powered by MHonArc 2.6.24.

Top of Page