Alex Martelli wrote: > Fuzzyman <[EMAIL PROTECTED]> wrote: > ... > > > Open the file with 'rU' mode, and check the file object's newline > > > attribute. > > > > Do you know if this works for multi-byte encodings ? Do files have > > You mean when you open them with the codecs module? >
No, if I open a UTF16 encoded file in universal mode - will it still have the correct lineending attribute ? 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 ? All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > > metadata associated with them showing the line-ending in use ? > > Not in the filesystems I'm familiar with (they did use to, in > filesystems used on VMS and other ancient OSs, but that was a very long > time ago). > > > Alex -- http://mail.python.org/mailman/listinfo/python-list