Re: Determining client_encoding from client locale

Поиск
Список
Период
Сортировка
От Itagaki Takahiro
Тема Re: Determining client_encoding from client locale
Дата
Msg-id 20090618094048.9503.52131E4D@oss.ntt.co.jp
обсуждение исходный текст
Ответ на Re: Determining client_encoding from client locale  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Determining client_encoding from client locale  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Determining client_encoding from client locale  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> wrote:

> On Wednesday 17 June 2009 14:29:26 Heikki Linnakangas wrote:
> > We currently require that you set client_encoding correctly, or you get
> > garbage in psql and any other tool using libpq. How about setting
> > client_encoding automatically to match the client's locale? We have
> > pg_get_encoding_from_locale() function that we can use to extract the
> > encoding from LC_CTYPE. We could call that in libpq.

+1 for psql, but -1 for libpq.

I think automatic determination is good for psql because it is
an end-user application, but is not always acceptable for middlewares.

Please imagine:
   Web Server <- Application Server <- Database Server   ----------    ------------------    ---------------     UTF-8
      Non-UTF8 env.            UTF-8
 

The Application Server might run on non-UTF8 environment
but it should send outputs in UTF8 encoding. Automatic
encoding determination might break existing services.

> I have been requesting that for years, but the Japanese users/developers 
> typically objected to that.  I think it's time to relaunch the campain, 
> though.

I assume that it is not a Japanese-specific problem and just because
they use multiple encodings. Encodings of OSes in Japan are often SJIS
or EUC_JP, but UTF8 is well-used in web-services and databases.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center




В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: Cannot use all four trigger events at once
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Determining client_encoding from client locale