Skip to content

Commit

Permalink
Merge pull request #8289 from borysiasty/csv_string_quoting
Browse files Browse the repository at this point in the history
[needs-docs] Save layer as CSV: add STRING_QUOTING option to the predefined drop-down widgets
  • Loading branch information
borysiasty committed Oct 24, 2018
2 parents 745526d + 61ebc18 commit 302529a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/qgsvectorfilewriter.cpp
Expand Up @@ -843,6 +843,17 @@ class QgsVectorFileWriterMetadataContainer
QStringLiteral( "COMMA" ) // Default value
) );

#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,3,0)
layerOptions.insert( QStringLiteral( "STRING_QUOTING" ), new QgsVectorFileWriter::SetOption(
QObject::tr( "Double-quote strings. IF_AMBIGUOUS means that string values that look like numbers will be quoted." ),
QStringList()
<< QStringLiteral( "IF_NEEDED" )
<< QStringLiteral( "IF_AMBIGUOUS" )
<< QStringLiteral( "ALWAYS" ),
QStringLiteral( "IF_AMBIGUOUS" ) // Default value
) );
#endif

layerOptions.insert( QStringLiteral( "WRITE_BOM" ), new QgsVectorFileWriter::BoolOption(
QObject::tr( "Write a UTF-8 Byte Order Mark (BOM) at the start of the file." ),
false // Default value
Expand Down

0 comments on commit 302529a

Please sign in to comment.