qgsogrprovider3.patch

a patch for solution number 3 - Minoru Akagi, 2012-08-01 11:04 PM

Download (1.02 KB)

View differences:

providers/ogr/qgsogrprovider.cpp 2012-08-02 15:00:00 +0900
23 23
#include <gdal.h>         // to collect version information
24 24
#include <ogr_api.h>
25 25
#include <ogr_srs_api.h>
26
#include <cpl_error.h>
27
#include <cpl_conv.h>
26
#include <cpl_string.h>
28 27

  
29 28
#include <limits>
30 29

  
......
2041 2040
    }
2042 2041
  }
2043 2042

  
2043
  char **papszOptions = NULL;
2044
  if ( driverName == "ESRI Shapefile" )
2045
  {
2046
    papszOptions = CSLSetNameValue( papszOptions, "ENCODING", "LDID/0" );
2047
  }
2048

  
2044 2049
  OGRLayerH layer;
2045
  layer = OGR_DS_CreateLayer( dataSource, TO8F( QFileInfo( uri ).completeBaseName() ), reference, OGRvectortype, NULL );
2050
  layer = OGR_DS_CreateLayer( dataSource, TO8F( QFileInfo( uri ).completeBaseName() ), reference, OGRvectortype, papszOptions );
2051
  CSLDestroy( papszOptions );
2046 2052
  if ( !layer )
2047 2053
  {
2048 2054
    QgsMessageLog::logMessage( QObject::tr( "Creation of OGR data source %1 failed: %2" ).arg( uri ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ), QObject::tr( "OGR" ) );