Skip to content

Commit fea86ea

Browse files
committedApr 12, 2013
ogr provider: don't ignore set encoding if SHAPE_ENCODING is set although OGR
still claims that strings are already UTF-8
1 parent 95f49be commit fea86ea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,8 @@ QStringList QgsOgrProvider::subLayers() const
503503
void QgsOgrProvider::setEncoding( const QString& e )
504504
{
505505
#if defined(OLCStringsAsUTF8)
506-
if ( !OGR_L_TestCapability( ogrLayer, OLCStringsAsUTF8 ) )
506+
QSettings settings;
507+
if ( settings.value( "/qgis/ignoreShapeEncoding", true ).toBool() && !OGR_L_TestCapability( ogrLayer, OLCStringsAsUTF8 ) )
507508
{
508509
QgsVectorDataProvider::setEncoding( e );
509510
}

1 commit comments

Comments
 (1)

minorua commented on Apr 13, 2013

@minorua
Contributor

In case that ignoreShapeEncoding option is off, even if TestCapability( OLCStringsAsUTF8 ) returns false (i.e. case of LDID/0), users cannnot select the encoding and then LDID/0 file is handled as UTF-8 file. Is this correct? Or I guess the logical operator is wrong.

Please sign in to comment.