Re: What's a good default encoding?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Junaili Lie" <junaili(at)gmail(dot)com>
Cc: "Michael Schmidt" <michaelmschmidt(at)msn(dot)com>, pgsql-general(at)postgresql(dot)org, CSN <cool_screen_name90001(at)yahoo(dot)com>
Subject: Re: What's a good default encoding?
Date: 2006-03-16 03:01:10
Message-ID: 11853.1142478070@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Junaili Lie" <junaili(at)gmail(dot)com> writes:
> I am wondering if somebody here can tell me the difference between
> UTF-8 and SQL-ASCII, whether there are any benefits of converting
> SQL-ASCII to UTF-8?

SQL_ASCII isn't really an encoding; it's more like a declaration of
ignorance. If the encoding is set to SQL_ASCII, the backend will store
any high-bit-on data you send it, and return it without any sort of
conversion.

If you are dealing with data beyond the 7-bit ASCII set, it's probably a
really bad idea to be using the SQL_ASCII setting, because the database
won't give you any help at all in checking for bad data or converting
between the encodings wanted by different client programs. There are a
few situations where this is what you want, but I think most people are
better off picking a specific encoding.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Adams 2006-03-16 03:02:56 Reprise of Oracle decode functionality...now with nifty plperlu (and two cupholders)
Previous Message Noel Faux 2006-03-16 03:00:56 Re: apparent loss of sys tables!! - help