Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
also optionally apply SHAPE_ENCODING to layer creation (fixes #5911)
  • Loading branch information
jef-n committed Feb 16, 2013
1 parent f22c62a commit 7fb4649
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/qgsvectorfilewriter.cpp
Expand Up @@ -97,6 +97,10 @@ QgsVectorFileWriter::QgsVectorFileWriter(
// find driver in OGR
OGRSFDriverH poDriver;
QgsApplication::registerOgrDrivers();

QSettings settings;
CPLSetConfigOption( "SHAPE_ENCODING", settings.value( "/qgis/ignoreShapeEncoding", true ).toBool() ? "" : 0 );

poDriver = OGRGetDriverByName( ogrDriverName.toLocal8Bit().data() );

if ( poDriver == NULL )
Expand Down Expand Up @@ -216,7 +220,6 @@ QgsVectorFileWriter::QgsVectorFileWriter(
{
QgsDebugMsg( "error finding QTextCodec for " + fileEncoding );

QSettings settings;
QString enc = settings.value( "/UI/encoding", "System" ).toString();
mCodec = QTextCodec::codecForName( enc.toLocal8Bit().constData() );
if ( !mCodec )
Expand Down

0 comments on commit 7fb4649

Please sign in to comment.