Change to enclose field values ​​with quotation character in exported CSV file if they contain delimiters in Spreadsheet workbench (#17140)

* Change to enclose field values ​​with quotation character in exported CSV file if they contain delimiters

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
H. Tsubota
2024-10-14 10:52:48 -05:00
committed by Chris Hennes
co-authored by pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
parent c8b53bdba6
commit 69ae9b2c46
+2 -1
View File
@@ -342,7 +342,8 @@ bool Sheet::exportToFile(const std::string& filename,
std::string str = field.str();
if (quoteChar && str.find(quoteChar) != std::string::npos) {
if (quoteChar
&& str.find_first_of(std::string(quoteChar, delimiter)) != std::string::npos) {
writeEscaped(str, quoteChar, escapeChar, file);
}
else {