Skip to Content.
Sympa Menu

freetds - Re: Charset problem in freetds

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Steve Langasek <vorlon AT netexpress.net>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Charset problem in freetds
  • Date: Sun, 4 Nov 2001 18:56:11 -0600

On Thu, Oct 18, 2001 at 03:05:11AM -0400, James K. Lowden wrote:

> > The safest thing would
> > be to default to latin_1 with a freetds.conf field allowing other
> > character sets. I was leaning towards UTF-8, but that's an easy conf file
> > change for non-western langs and gives a lot of flexibility to those folks
> > to choose from a variety of charsets and not be pinned into UTF-8 if the
> > app is not unicode-aware. Therefore I propose a 'tds7 client charset'
> > field in freetds.conf to have a value of any iconv charset label (iconv
> > --list on linux to view).

> I lost you there. Sybase infers the client's character set from the
> LANG and LC_ALL variables. I'd say if they're not set you get
> ISO-8859-1, else you get something reasonable based on them.

> I admit there's a *huge* failure of standardization when it comes to
> just what string you'll find in LC_ALL. But in the scheme of things,
> that's not the greatest evil.

Not exactly inference... The problem is that, except when the charset
is explicit (e.g., en_US.UTF-8), there's no standard way to extract a
charset/encoding given a locale name. So we need a mapping table, just
like OpenClient does, that specifies what charsets are to be used as the
defaults for what locales.

As for using ISO-8859-1 as a default charset... The charset
corresponding to the C locale is ASCII, not Latin-1. There are
big-picture advantages to using UTF-8 as the default charset, but if
it's not possible to use UTF-8 (the union-of-all-charsets charset), the
default should be ASCII (the intersection-of-all-charsets charset) and
not Latin-1 (the
we-write-most-of-the-world's-software-and-can-get-away-with-it charset ;).
One way or another, everyone really ought to be on an equal footing wrt
localization.

But I suppose in one sense, that's the case with ISO-8859-1 as well.
Note that after January 1, Latin-1 no longer meets the needs even of a
majority of European users, as it lacks the Euro symbol.

> > I know OpenClient uses the locales.dat file to map en_US for instance to a
> > language/charset pairing. Maybe we need something similar for Sybase
> > charset -> iconv charset mapping.

> I think so.

Steve Langasek
postmodern programmer

Attachment: pgpohwtbvAXZU.pgp
Description: PGP signature



  • Re: Charset problem in freetds, Steve Langasek, 11/04/2001

Archive powered by MHonArc 2.6.24.

Top of Page