Skip to Content.
Sympa Menu

freetds - Re: [freetds] Charset question

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Steve Langasek <vorlon AT dodds.net>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] Charset question
  • Date: Wed, 19 Apr 2006 20:43:08 -0700

On Wed, Apr 19, 2006 at 09:09:32PM -0400, James K. Lowden wrote:
> > There are some points to resolve. Why do patch set client_charset and
> > also char_set (now server_charset)? IMO should set just client_charset
> > and let other code find better server_charset that match client one.

> Agreed. The server should announce its charset, and FreeTDS should
> consistently use GNU names for client_charset.

Does the server in fact announce its charset? It was my impression that
the wire charset was negotiated between the client and server with the
client requesting a charset?

> > Perhaps is useful if we want to
> > specify the server charset when server is not able to handle client
> > translated correctly (this happen for instance using utf8 for older
> > server).

> Sybse servers that support only TDS 4.2 are over 10 years old now;
> Microsoft adopted TDS 7.0 in 2000? I doubt anyone is running SQL Server
> 6.5 with a utf-8 client.

Does that mean you think no one is using FreeTDS with SQL 6.5? In that
case, wouldn't it be best to disallow use of TDS 4.2 to prevent accidental
charset mismatches? :)

> > > 4. Charset information is used both by iconv and in the TDS 5.0
> > > login.

> > Yes, and I would add that server_charset is used only for Sybase (or
> > former mssql versions) and only as an override for some server settings.

> To clarify: A TDS 5.0 sends, as part of the login packet, a *client*
> charset to tell the server how it wants to see character data encoded.
> The string is a Sybase name (not, say, a GNU iconv name). The server will
> comply, and data on the wire will use the client charset. (The server's
> encoding -- how the data are stored on the server -- is a different
> question. Perhaps I chose badly; I think I dreamed up "server charset"
> when what I really meant was "wire charset".)

> The distinction could matter: Sybase may use a "wire charset" of utf-8 to
> make its client happy, but if the server's data are encoded as ISO 8859-1,
> there will be trouble when the client tries to send a Greek Beta symbol
> (or a Euro sign).

So is the point here that locales.conf and the locale should not influence
the wire charset? In general, I would rather trust the client system's
ability to do charset conversion and so I agree that it would be better if
the wire charset were chosen based on server information rather than
information about the client locale; I just don't see where we get such
information on a per-server basis other than configuring it in freetds.conf.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
vorlon AT debian.org http://www.debian.org/

Attachment: signature.asc
Description: Digital signature




Archive powered by MHonArc 2.6.24.

Top of Page