diff --git a/gnucash/import-export/csv-imp/gnc-tokenizer.cpp b/gnucash/import-export/csv-imp/gnc-tokenizer.cpp index 0a15fa042b..2f54db6aae 100644 --- a/gnucash/import-export/csv-imp/gnc-tokenizer.cpp +++ b/gnucash/import-export/csv-imp/gnc-tokenizer.cpp @@ -12,6 +12,7 @@ #include #include +#include extern "C" { #include @@ -79,6 +80,11 @@ GncTokenizer::encoding(const std::string& encoding) { m_enc_str = encoding; m_utf8_contents = boost::locale::conv::to_utf(m_raw_contents, m_enc_str); + + // While we are converting here, let's also normalize line-endings to "\n" + // That's what STL expects by default + boost::replace_all (m_utf8_contents, "\r\n", "\n"); + boost::replace_all (m_utf8_contents, "\r", "\n"); } const std::string&