tomer filiba wrote:
> [Talin]
> 
>>Well, as far as readline goes: In order to split the text into lines,
>>you have to decode the text first anyway, which is a layer 3 operation.
>>You can't just read bytes until you get a \n, because the file you are
>>reading might be encoded in UCS2 or something.
> 
> well, the LineBufferedLayer can be "configured" to split on any
> "marker", i.e.: LineBufferedLayer(stream, marker = "\x00\x0a")
> and of course layer 3, which creates layer 2, can set this marker
> to any byte sequence. note it's a *byte* sequence, not chars,
> since this passes down to layer 1 transparently.

That isn't what is required; for big-endian UCS-2 or UTF-16, "\x00\x0a"
should only be recognized as LF if it is at an even byte position.

-- 
David Hopwood <[EMAIL PROTECTED]>


_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to