Support UTF-8 files with BOM in COPY FROM

Itagaki Takahiro <itagaki.takahiro@gmail.com>

From: Itagaki Takahiro <itagaki.takahiro@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2011-09-26T04:58:42Z
Lists: pgsql-hackers

Attachments

Hi,

I'd like to support UTF-8 text or csv files that has BOM (byte order mark)
in COPY FROM command. BOM will be automatically detected and ignored
if the file encoding is UTF-8. WIP patch attached.

I'm thinking about only COPY FROM for reads, but if someone wants to add
BOM in COPY TO, we might also support COPY TO WITH BOM for writes.

Comments welcome.

-- 
Itagaki Takahiro