Re: Special characters in varchar/text fields

From: Richard Huxton <dev(at)archonet(dot)com>
To: Lynna Landstreet <lynna(at)gallery44(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Special characters in varchar/text fields
Date: 2003-06-07 12:15:08
Message-ID: 200306071315.08216.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday 06 Jun 2003 9:20 pm, Lynna Landstreet wrote:
> The question I tried to post yesterday never made it to the list at all,
> but in the spirit of blind optimism I'm trying again with a new one.
Well you made it this time.

[snip question about handling accents]

> Is there any way to either (a) turn special characters into the appropriate
> ASCII codes when the form is processed, or (b) enable PostgreSQL to handle
> them directly? (b) would probably be the better of the two options, if
> possible...

OK - PostgreSQL actually has quite good handling for this sort of stuff - the
terms you need to search the archives on are "locale" or "localization" (or
localisation).

There are several aspects to this sort of thing:
1. What characters can I store?
2. How do I sort text?
3. How do I display dates?
4. How do I display currency?
etc.

There's a whole chapter on this in the manuals (Localization) - read it
carefully, especially the bit about setting encodings when creating the
database.
The two key questions you'll want to ask yourself are
1. What character set do I want (ISO 8859-1/Unicode etc)
2. Do I want to sort by a particular language?

Best of luck - this and timezones are a real PITA - not so much PGs fault as
the universe's.

--
Richard Huxton

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Cristian Custodio 2003-06-07 13:06:38 Trouble to understand plain of postgresql
Previous Message Nigel J. Andrews 2003-06-07 11:07:36 Re: update phenomenom