question about csv.DictReader

Tim Chase python.list at tim.thechases.com
Wed Apr 3 22:52:26 EDT 2013


On 2013-04-03 18:26, Norman Clerman wrote:
> Can anyone explain the presence of the characters "\xref\xbb\xbf"
> before the first field contents "Holdings" ?

(you mean "\xef", not "\xref")

This is a byte-order-mark (BOM), which you can read about at [1].  In
this case, it denotes the file as UTF-8 encoded.  Certain programs
insert these, though it's more important with UTF-16 or UTF-32
encodings where the byte-order and endian'ness actually matters.  I
believe Notepad and Visual Studio on Win32 were both offenders when
it came to inserting unbidden BOMs.

-tkc

[1]
http://en.wikipedia.org/wiki/Byte_order_mark



More information about the Python-list mailing list