Skip to content
Permalink
Browse files

Merge pull request #8289 from borysiasty/csv_string_quoting

[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 302529a10c8e5d033588985ed51b1cf7861625dd
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/core/qgsvectorfilewriter.cpp
@@ -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

0 comments on commit 302529a

Please sign in to comment.
You can’t perform that action at this time.