Re: Using psql -f to load a UTF8 file

Поиск
Список
Период
Сортировка
От Alan Millington
Тема Re: Using psql -f to load a UTF8 file
Дата
Msg-id 1348162042.84227.YahooMailNeo@web28904.mail.ir2.yahoo.com
обсуждение исходный текст
Ответ на Re: Using psql -f to load a UTF8 file  (Leif Biberg Kristensen <leif@solumslekt.org>)
Ответы Re: Using psql -f to load a UTF8 file  (John R Pierce <pierce@hogranch.com>)
Re: Using psql -f to load a UTF8 file  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
Thank you for the link. I am using Notepad, which inserts the byte order mark. Following the links a bit further, I gather that the version of Notepad that I am using may not identify a UTF8 file correctly if the byte order mark is omitted. Also, as I mentioned, Python makes use of it. (From the Python documentation on Encoding declarations: "If the first bytes of the file are the UTF-8 byte-order mark ('\xef\xbb\xbf'), the declared file encoding is UTF-8 (this is supported, among others, by Microsoft’s Notepad).")
 
The conclusion seems to be that I must use one editor for Python, and another for Postgres.
 

From: Leif Biberg Kristensen <leif@solumslekt.org>
To: Postgres general mailing list <pgsql-general@postgresql.org>
Cc: Alan Millington <admillington@yahoo.co.uk>
Sent: Thursday, 20 September 2012, 16:44
Subject: Re: [GENERAL] Using psql -f to load a UTF8 file

Torsdag 20. september 2012 16.56.16 skrev Alan Millington :
> psql". But how am I supposed to remove the byte order mark from a UTF8
> file? I thought that the whole point of the byte order mark was to tell
> programs what the file encoding is. Other programs, such as Python, rely
> on this.

http://en.wikipedia.org/wiki/Byte_order_mark

While the Byte Order Mark is important for UTF-16, it's totally irrelevant to
the UTF-8 encoding. Still you'll find several editors that automatically input
BOMs in every text file. There is usually a setting "Insert Byte Order Mark"
somewhere in the configuration, and it may be on by default.

regards, Leif


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

Предыдущее
От: Benedikt Grundmann
Дата:
Сообщение: Expression to construct a anonymous record with named columns?
Следующее
От: Chris Travers
Дата:
Сообщение: Re: foreign key from array element