Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #25995
| From | cpppwner@gmail.com |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Python 2.6 StreamReader.readline() |
| Date | 2012-07-24 08:01 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <65c7dc3b-3dce-45f2-981b-9c8171418f09@googlegroups.com> (permalink) |
Hi,
I have a simple question, I'm using something like the following lines in python 2.6.2
reader = codecs.getreader(encoding)
lines = []
with open(filename, 'rb') as f:
lines = reader(f, 'strict').readlines(keepends=False)
where encoding == 'utf-16-be'
Everything works fine, except that lines[0] is equal to codecs.BOM_UTF16_BE
Is this behaviour correct, that the BOM is still present?
Thanks in advance for your help.
Best,
Stefan
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Python 2.6 StreamReader.readline() cpppwner@gmail.com - 2012-07-24 08:01 -0700
Re: Python 2.6 StreamReader.readline() Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-07-25 08:09 +0200
Re: Python 2.6 StreamReader.readline() Walter Dörwald <walter@livinglogic.de> - 2012-07-25 11:02 +0200
Re: Python 2.6 StreamReader.readline() wxjmfauth@gmail.com - 2012-07-25 03:26 -0700
Re: Python 2.6 StreamReader.readline() wxjmfauth@gmail.com - 2012-07-25 03:26 -0700
csiph-web