Re: Determining client_encoding from client locale

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Subject: Re: Determining client_encoding from client locale
Date: 2009-06-17 15:14:01
Message-ID: 26956.1245251641@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> 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.

> 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 think at least part of the issue is lack of confidence in our code for
extracting an encoding setting from the locale environment. Do we
really think it's solid now, on all platforms? The current uses of
pg_get_encoding_from_locale are all designed to put little faith in it,
and what's more it's had exactly zero non-beta field experience.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-06-17 15:25:12 Re: plpgsql error message
Previous Message Tom Lane 2009-06-17 15:08:38 Re: Named transaction