Skip site navigation (1) Skip section navigation (2)

Re: Support UTF-8 files with BOM in COPY FROM

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support UTF-8 files with BOM in COPY FROM
Date: 2011-09-26 06:14:03
Message-ID: E7BE1BF0-CAB4-413A-9DB8-21D5927905C5@kineticode.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sep 25, 2011, at 9:58 PM, Itagaki Takahiro wrote:

> 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.

By my reading of http://unicode.org/faq/utf_bom.html#bom5, I'd say +1

So I think what you propose makes sense.

> 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.

I think it would have to be optional, since "some recipients of UTF-8 encoded data do not expect a BOM."

Best,

David


In response to

Responses

pgsql-hackers by date

Next:From: Fujii MasaoDate: 2011-09-26 08:07:21
Subject: Re: Remastering using streaming only replication?
Previous:From: Itagaki TakahiroDate: 2011-09-26 04:58:42
Subject: Support UTF-8 files with BOM in COPY FROM

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group