1
0
Fork 0

arangoexport fix csv export escaping

This commit is contained in:
baslr 2017-03-01 17:10:22 +01:00
parent 02c021f7a6
commit ed8e939a10
1 changed files with 5 additions and 1 deletions

View File

@ -398,7 +398,11 @@ void ExportFeature::writeCollectionBatch(int fd, VPackArrayIterator it, std::str
} }
value = std::regex_replace(value, std::regex("\""), "\"\""); value = std::regex_replace(value, std::regex("\""), "\"\"");
value = std::regex_replace(value, std::regex(","), "\",");
if (value.find(",") != std::string::npos || value.find("\"\"") != std::string::npos) {
value = "\"" + value;
value.append("\"");
}
} }
line.append(value); line.append(value);
} }