Strip trailing space and normalize line endings.