Preserve line-ending encoding of single-file packages

See #619