Skip to content

Commit

Permalink
ogr provider: don't ignore set encoding if SHAPE_ENCODING is set alth…
Browse files Browse the repository at this point in the history
…ough OGR

still claims that strings are already UTF-8
  • Loading branch information
jef-n committed Apr 12, 2013
1 parent 95f49be commit fea86ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -503,7 +503,8 @@ QStringList QgsOgrProvider::subLayers() const
void QgsOgrProvider::setEncoding( const QString& e )
{
#if defined(OLCStringsAsUTF8)
if ( !OGR_L_TestCapability( ogrLayer, OLCStringsAsUTF8 ) )
QSettings settings;
if ( settings.value( "/qgis/ignoreShapeEncoding", true ).toBool() && !OGR_L_TestCapability( ogrLayer, OLCStringsAsUTF8 ) )
{
QgsVectorDataProvider::setEncoding( e );
}
Expand Down

1 comment on commit fea86ea

@minorua
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.