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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user