Обсуждение: Re: [ODBC] pgAdmin2 UTF-8 support

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

Re: [ODBC] pgAdmin2 UTF-8 support

От
Dave Page
Дата:

> -----Original Message-----
> From: Jean-Michel POURE [mailto:jm.poure@freesurf.fr]
> Sent: 25 February 2002 08:18
> To: Dave Page
> Cc: pgadmin-hackers@postgresql.org
> Subject: Re: [pgadmin-hackers] [ODBC] pgAdmin2 UTF-8 support
>
>
> Dear Dave,
>
> I used pgsql with PostgreSQL 7.2 and noticed there was an automatic
> translation between UTF-8 <-> Latin characters. This is a new
> feature of
> PostgreSQL 7.2.
>
> So fine :
>
> Suppose we have a Unicode database :
> \Encoding Latin1 (\same with \Encoding SQL_ASCII does not
> work) INSERT INTO table_foo (field_bar) VALUES ('é'); SELECT
> field_bar FROM table_foo WHERE field_bar='é' works. I checked
> the UTF-8 display in Apache, it works.
>
> In the case of an UTF-8 database, it means we need to create
> and query schema
> objects using \Encoding Latin1. Should it be done at ODBC level or at
> pgAdmin2 level? What is your opinion?
>
> This could help us display non-multibyte UTF-8 data as well.

Presumably we should do this in SQL (I don't think you can do it in the ODBC
connect string can you?). Have you tried in pgAdmin:

SET CLIENT_ENCODING Latin1;
INSERT INTO table_foo (field_bar) VALUES ('é'); SELECT field_bar FROM
table_foo WHERE field_bar='é';

Regards, Dave.

Re: [ODBC] pgAdmin2 UTF-8 support

От
Jean-Michel POURE
Дата:
Le Lundi 25 Février 2002 09:29, Dave Page a écrit :
> Presumably we should do this in SQL (I don't think you can do it in the
> ODBC connect string can you?). Have you tried in pgAdmin:
>
> SET CLIENT_ENCODING Latin1;
> INSERT INTO table_foo (field_bar) VALUES ('é'); SELECT field_bar FROM
> table_foo WHERE field_bar='é';

I just tried it, it works !!!
Apache + Php display the 'é'.

Victory !

Re: [ODBC] pgAdmin2 UTF-8 support

От
Jean-Michel POURE
Дата:
Le Lundi 25 Février 2002 09:29, Dave Page a écrit :
> SET CLIENT_ENCODING Latin1;
> INSERT INTO table_foo (field_bar) VALUES ('é'); SELECT field_bar FROM
> table_foo WHERE field_bar='é';

In case of an UTF-8 database,
- schema queries should always be sent in Latin1.
- SQL highlightbox should allow to choose client encoding on the fly in a
combo.

How do we query current client encoding?

Cheers,
Jean-Michel