I tried using the std::replace algorithm:
replace(out.begin(), out.end(), '\r', '\r\n');    // error
replace(out.begin(), out.end(), "\r", "\r\n");    // error
replace(out.begin(), out.end(), "\\r", "\\r\\n"); // error
I always get errors that the parameters are ambigous. How exactly can I specify the \r and \n so the compiler will not complain ? 
edit:
errors:
 could not deduce template argument for 'const _Ty &' from 'const char [5]' 
 template parameter '_Ty' is ambiguous
'replace': no matching overloaded function found    
 
    