Skip to content
Permalink
Browse files

Always set "SHAPE_ENCODING" GDAL config option to "" in QgsVectorFile…

…Writer (follows up commit:c0551a6)
  • Loading branch information
borysiasty committed Apr 25, 2013
1 parent 89f34b2 commit 320d90a20b0c9483fe281ede1b8ae590078c90f1
Showing with 2 additions and 12 deletions.
  1. +2 −12 src/core/qgsvectorfilewriter.cpp
@@ -109,25 +109,14 @@ QgsVectorFileWriter::QgsVectorFileWriter(
return;
}

QSettings settings;

if ( driverName == "ESRI Shapefile" )
{
if ( layOptions.join( "" ).toUpper().indexOf( "ENCODING=" ) == -1 )
{
layOptions.append( "ENCODING=" + fileEncoding );
}

if ( settings.value( "/qgis/ignoreShapeEncoding", true ).toBool() )
{
CPLSetConfigOption( "SHAPE_ENCODING", "" );
}
else
{
CPLSetConfigOption( "SHAPE_ENCODING", fileEncoding.toLocal8Bit().data() );
// WARNING!! If SHAPE_ENCODING and -lco ENCODING are used, the fileEncoding must be set to the layer internal encoding!!
fileEncoding = "UTF-8";
}
CPLSetConfigOption( "SHAPE_ENCODING", "" );

if ( !vectorFileName.endsWith( ".shp", Qt::CaseInsensitive ) &&
!vectorFileName.endsWith( ".dbf", Qt::CaseInsensitive ) )
@@ -235,6 +224,7 @@ 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 )

0 comments on commit 320d90a

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