Re: UTF8 with BOM support in psql

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: UTF8 with BOM support in psql
Дата
Msg-id 4B03FC14.4080703@dunslane.net
обсуждение исходный текст
Ответ на Re: UTF8 with BOM support in psql  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: UTF8 with BOM support in psql
Список pgsql-hackers

Peter Eisentraut wrote:
> But now we're back to the original problem.  Certain editors insert BOMs
> at the beginning of the file.  And that is by any definition before the
> embedded client encoding declaration.  I think the only ways to solve
> this are:
>
> 1) Ignore the BOM if a client encoding declaration of UTF8 appears in a
> narrowly defined location near the beginning of the file (XML and
> PEP-0263 style).  For *example*, we could ignore the BOM if the file
> starts with exactly "<BOM>\encoding UTF8\n".  Would probably not work
> well in practice.
>
> 2) Parse two alternative versions of the file, one with the BOM ignored
> and one with the BOM not ignored, until you need to make a decision.
> Hilariously complicated, but would perhaps solve the problem.
>
> 3) Give up, do nothing.
>
>   

4) set the client encoding before the file is read in any of the ways 
that have already been discussed and then allow psql to eat the BOM.

cheers

andrew


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: RFC for adding typmods to functions
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: operator exclusion constraints