Try to fix #3131 by opening the batch queue CSV file in binary mode to prevent any unwanted implicit text codec conversion on Windows.

This commit is contained in:
Adam Reichold
2016-02-05 21:20:25 +01:00
parent 8c3e6eab95
commit b6ffe04c46

View File

@@ -217,7 +217,7 @@ bool BatchQueue::saveBatchQueue ()
{
const auto fileName = Glib::build_filename (options.rtdir, "batch", "queue.csv");
std::ofstream file (fileName, std::ios::trunc);
std::ofstream file (fileName, std::ios::binary | std::ios::trunc);
if (!file.is_open ())
return false;
@@ -256,7 +256,7 @@ bool BatchQueue::loadBatchQueue ()
{
const auto fileName = Glib::build_filename (options.rtdir, "batch", "queue.csv");
std::ifstream file (fileName);
std::ifstream file (fileName, std::ios::binary);
if (file.is_open ()) {
// Yes, it's better to get the lock for the whole file reading,