Re: encoding using the odbc driver

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joel Fradkin" <jfradkin(at)wazagua(dot)com>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: encoding using the odbc driver
Date: 2005-02-18 19:40:11
Message-ID: 20377.1108755611@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

"Joel Fradkin" <jfradkin(at)wazagua(dot)com> writes:
> I changed my encoding from SQL_ASCII to UNICODE.
> I believe the Unicode is supposed to support more languages?

I think you're missing the point. The SQL_ASCII setting isn't an
encoding, really; it's a declaration of ignorance. In this setting
the server will just store and regurgitate whatever character strings
you send it. This will work fine, more or less, if all your clients
use exactly the same encoding and you don't care about functions like
upper()/lower().

When you use UNICODE (or any other setting) then the server tries to
enforce that what's stored in the database is actually valid data per
that encoding. It will also provide encoding conversion for clients
who select a different specific client_encoding. But a client that
sets client_encoding = SQL_ASCII defeats the conversion and will see
whatever's stored in the database.

If you flip between SQL_ASCII and other settings, on either end, without
clearly understanding what's happening, you're likely to get very
confused.

regards, tom lane

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Joel Fradkin 2005-02-18 19:55:35 Re: encoding using the odbc driver
Previous Message Joel Fradkin 2005-02-18 18:44:44 encoding using the odbc driver