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
This commit is contained in:
Borys Jurgiel 2018-10-24 18:37:32 +02:00 committed by GitHub
commit 302529a10c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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