Re: Support UTF-8 files with BOM in COPY FROM - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Support UTF-8 files with BOM in COPY FROM
Date
Msg-id 1317062314.29925.7.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: Support UTF-8 files with BOM in COPY FROM  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Support UTF-8 files with BOM in COPY FROM
Re: Support UTF-8 files with BOM in COPY FROM
List pgsql-hackers
On mån, 2011-09-26 at 13:19 -0400, Robert Haas wrote:
> The thing that makes me doubt that is this comment from Tatsuo Ishii:
> 
> TI> COPY explicitly specifies the encoding (to be UTF-8 in this case).
> So
> TI> I think we should not regard U+FEFF as "BOM" in COPY, rather we
> should
> TI> regard U+FEFF as "ZERO WIDTH NO-BREAK SPACE".
> 
> If a BOM is confusable with valid data, then I think recognizing it
> and discarding it unconditionally is no good - you could end up where
> COPY OUT, TRUNCATE, COPY IN changes the table contents.

We did recently accept a patch for psql -f to skip over a UTF-8
byte-order mark.  We had a lot of this same discussion there.



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [v9.2] Fix Leaky View Problem
Next
From: Robert Haas
Date:
Subject: Re: Support UTF-8 files with BOM in COPY FROM