Windows: handle newlines correctly