[QGIS Commit] r14490 - trunk/qgis/src/providers/ogr

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Nov 2 13:42:25 EDT 2010


Author: jef
Date: 2010-11-02 10:42:25 -0700 (Tue, 02 Nov 2010)
New Revision: 14490

Modified:
   trunk/qgis/src/providers/ogr/qgsogrprovider.cpp
Log:
fix #2903

Modified: trunk/qgis/src/providers/ogr/qgsogrprovider.cpp
===================================================================
--- trunk/qgis/src/providers/ogr/qgsogrprovider.cpp	2010-11-01 22:06:38 UTC (rev 14489)
+++ trunk/qgis/src/providers/ogr/qgsogrprovider.cpp	2010-11-02 17:42:25 UTC (rev 14490)
@@ -1665,7 +1665,14 @@
   //create the attribute fields
 
   QTextCodec* codec = QTextCodec::codecForName( encoding.toLocal8Bit().data() );
+  if ( !codec )
+  {
+    // fall back to "System" codec
+    codec = QTextCodec::codecForLocale();
+    Q_ASSERT( codec );
+  }
 
+
   for ( std::list<std::pair<QString, QString> >::const_iterator it = attributes.begin(); it != attributes.end(); ++it )
   {
     QStringList fields = it->second.split( ";" );



More information about the QGIS-commit mailing list