Skip to content
Permalink
Browse files

[needs-docs] Save vector layer as CSV: add STRING_QUOTING (IF_NEEDED|…

…IF_AMBIGUOUS|ALWAYS) create option to the predefined drop-down widgets. Only available with GDAL >= 2.3 (from that GDAL version the default value changed from IF_NEEDED to IF_AMBIGUOUS, so integer values became double-quoted by default)
  • Loading branch information
borysiasty committed Oct 23, 2018
1 parent f346dce commit f227bfb685abb2ca261f2d73375c70ff9fcd826d
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_AMBIGUOUS" )
<< QStringLiteral( "IF_NEEDED" )
<< 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 f227bfb

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