â in text field

Поиск
Список
Период
Сортировка
Искать

â in text field

От:
CSN <cool_screen_name90001@yahoo.com>
Дата:
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?

Thanks,
CSN

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: â in text field

От:
John DeSoi <desoi@pgedit.com>
Дата:

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

FAQ