Split lines in a more cross-platform compatible way