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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Support UTF-8 files with BOM in COPY FROM
Дата
Msg-id 10446.1317059547@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Support UTF-8 files with BOM in COPY FROM  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Sep 26, 2011 at 1:28 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert Haas <robertmhaas@gmail.com> writes:
>>> 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".

>> Yeah, that's a reasonable argument for rejecting the patch altogether.

> Yeah, or for making the behavior optional.

Sorry, I should have been clearer: it's an argument for rejecting *this*
patch.  A patch that introduced a "BOM" option for COPY (which logically
could apply just as well to input or output) would be a different patch.

BTW, another issue with the patch-as-proposed is that it assumes,
without even checking, that fseek() will work (for that matter, it would
also fail pretty miserably on a file shorter than 3 bytes).  We could
dodge that problem with an option since it would be reasonable to define
the option as meaning that there MUST be a BOM there.  I would envision
it as acting much like the CSV HEADER option.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Support UTF-8 files with BOM in COPY FROM
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Support UTF-8 files with BOM in COPY FROM