Detecting line endings

Alex Martelli aleaxit at yahoo.com
Tue Feb 7 22:35:47 EST 2006


Fuzzyman <fuzzyman at gmail.com> wrote:
   ...
> I can't open with a codec unless an encoding is explicitly supplied.  I
> still want to detect UTF16 even if the encoding isn't specified.
> 
> As I said, I ought to test this... Without metadata I wonder how Python
> determines it ?

It doesn't.  Python doesn't even try to guess: nor would any other
sensible programming language.


Alex



More information about the Python-list mailing list