Use 'try' to handle multiple EOL styles.