Re: UTF8 with BOM support in psql - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: UTF8 with BOM support in psql
Date
Msg-id 1258477390.10724.25.camel@fsopti579.F-Secure.com
Whole thread Raw
In response to Re: UTF8 with BOM support in psql  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: UTF8 with BOM support in psql
List pgsql-hackers
On tis, 2009-11-17 at 09:31 +0900, Itagaki Takahiro wrote:
> Peter Eisentraut <peter_e@gmx.net> wrote:
> 
> > OK, I think the consensus here is:
> > - Eat BOM at beginning of file (as you implemented)
> > - Only when client encoding is UTF-8 --> please fix that
> 
> Are they AND condition? If so, this patch will be useless.
> Please remember \encoding or SET client_encoding appear
> *after* BOM at beginning of file.

Presumably, if you have editors throwing in BOM marks without asking,
you have an environment where either

a) You can set the client encoding to UTF8 in the environment, so it
applies by default, or

b) The server encoding is UTF8, so the client encoding will default to
that.

Together, that should cover a lot of cases.  Not perfect, but far from
useless.



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: plpythonu DO support (inline call handler)
Next
From: Peter Eisentraut
Date:
Subject: Re: UTF8 with BOM support in psql