Index: src/app/qgshandlebadlayers.cpp =================================================================== --- src/app/qgshandlebadlayers.cpp (revision 15380) +++ src/app/qgshandlebadlayers.cpp (working copy) @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -102,8 +103,7 @@ } else if ( provider == "delimitedtext" ) { - QStringList theURIParts = datasource.split( "?" ); - filename = theURIParts[0]; + filename = QUrl::fromEncoded(datasource.toAscii()).toLocalFile(); } else if ( provider == "postgres" || provider == "sqlanywhere" ) { @@ -296,9 +296,10 @@ } else if ( provider == "delimitedtext" ) { - QStringList theURIParts = datasource.split( "?" ); - theURIParts[0] = filename; - datasource = theURIParts.join( "?" ); + QUrl uriSource = QUrl::fromEncoded(datasource.toAscii()); + QUrl uriNew = QUrl::fromLocalFile(filename); + uriNew.setQueryItems(uriSource.queryItems()); + datasource = QString::fromAscii(uriNew.toEncoded()); } } else Index: src/core/qgsmaplayer.cpp =================================================================== --- src/core/qgsmaplayer.cpp (revision 15380) +++ src/core/qgsmaplayer.cpp (working copy) @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -179,9 +180,12 @@ } else if ( provider == "delimitedtext" ) { - QStringList theURIParts = mDataSource.split( "?" ); - theURIParts[0] = QgsProject::instance()->readPath( theURIParts[0] ); - mDataSource = theURIParts.join( "?" ); + QUrl url = QUrl::fromEncoded(mDataSource.toAscii()); + QString file = url.toLocalFile(); + file = QgsProject::instance()->readPath(file); + QUrl urlNew = QUrl::fromLocalFile(file); + urlNew.setQueryItems( url.queryItems()); + mDataSource = QString::fromAscii( urlNew.toEncoded()); } else { Index: src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp =================================================================== --- src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp (revision 15380) +++ src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp (working copy) @@ -133,7 +133,7 @@ // add the layer to the map - QString uri( url.toEncoded() ); + QString uri = QString::fromAscii( url.toEncoded() ); emit drawVectorLayer( uri, txtLayerName->text(), "delimitedtext" ); // store the settings Index: src/providers/delimitedtext/qgsdelimitedtextprovider.cpp =================================================================== --- src/providers/delimitedtext/qgsdelimitedtextprovider.cpp (revision 15380) +++ src/providers/delimitedtext/qgsdelimitedtextprovider.cpp (working copy) @@ -150,7 +150,7 @@ , mWkbType( QGis::WKBNoGeometry ) { - QUrl url = QUrl::fromEncoded( uri.toUtf8() ); + QUrl url = QUrl::fromEncoded( uri.toAscii() ); // Extract the provider definition from the url