Skip to Content.
Sympa Menu

freetds - Re: [freetds] Re: hex(92), freeTDS and MS SQL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Re: hex(92), freeTDS and MS SQL
  • Date: Wed, 27 Oct 2004 23:18:37 -0400

"Adam Prime x443" <aprime AT brunico.com> wrote:
> well, i changed the conf to says window-1252 and restarted apache. conf
> looks like this:
>
> [clients]
> host = 10.10.10.20
> port = 1433
> tds version = 7.0
> client charset = windows-1252
> text size = 512000
> dump file = /tmp/freetds.log
> debug level = 99
>
> the log says this on connection:
>
> 2004-10-27 17:04:49 inside tds_process_login_tokens()

Hmm. The log should have said more than that. In particular, it should
have indicated what client encoding would be used. Unless you're using an
old version of FreeTDS, that is.

It's very important that you set the --with-libiconv-prefix option for
./configure, and that "windows-1252" is a valid name for your libiconv.

I think the reason the server converted the "smart quote" to '?' is, as
Chuck alluded, that that character doesn't exist in ISO-8859-1, which is
what the server expects the client to use (by default). Put another way,
in ISO-8859-1 the value 0x92 doesn't represent any character. IMO the
server should have rejected the input (Sybase does). But, given that the
server accepted the string, substituting '?' is a logical choice.

Once your 'client charset' setting matches what the client is actually
using, FreeTDS can convert the 0x92 something valid, provided -- and it's
a big proviso -- provided that the server encoding you use can represent
it. If you're using a single-byte-encoded datatype (char/varchar/text),
you have to be careful. If you use nchar/nvchar/ntext OTOH, you're free
and clear. (If you haven't already, you might want to read up on setting
the server's encoding.)

I wouldn't rely on TDS 4.2, no. You're bound to bump into other
limitations sooner or later.

Hope this helps.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page