Added detection of mis-stated encodings on import, detects line-end types.