cross-platform friendly line ending handling.