Re: â in text field - Mailing list pgsql-general

From John DeSoi
Subject Re: â in text field
Date
Msg-id 0FF4EF1A-4699-4077-8E3E-63EBE92AC4B0@pgedit.com
Whole thread Raw
In response to â in text field  (CSN <cool_screen_name90001@yahoo.com>)
List pgsql-general
On Mar 13, 2006, at 9:24 PM, CSN wrote:

> I'm updating a field via a web form, and an em-dash is
> getting stored in the database as 'âÂ-', and is
> getting displayed back on the web page as '— '. The
> encoding of the database is SQL_ASCII - should I
> change it? And if so, to what and how?

Yes, you should change it. None of the non-ASCII characters are going
to be properly encoded in the database. What you should change it to
depends the software you are using to process the form. You need to
make sure the client_encoding setting of your connection matches what
you are working with on the form.

Normally you could change the database encoding by dumping and then
reloading the database. But you'll likely have problems because your
SQL_ASCII encoded database has illegal characters that won't be
accepted if you change to something like UTF-8. A utility like iconv
might help with this.




John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


pgsql-general by date:

Previous
From: John DeSoi
Date:
Subject: Re: What's a good default encoding?
Next
From: Nick Johnson
Date:
Subject: Re: Dynamic function execution?