Replace all linebreaks with \r to eliminate cross-platform EOL issues