fix issues with non-ASCII filenames in GDALTools, thanks to Evgenia for

pointing on this problem
This commit is contained in:
Alexander Bruy 2013-02-11 12:49:05 +04:00
parent dd1bb457d2
commit 8970a1fde5
5 changed files with 6 additions and 6 deletions

View File

@ -802,6 +802,7 @@ def setProcessEnvironment(process):
envvar_list = {
"PATH" : getGdalBinPath(),
"PYTHONPATH" : getGdalPymodPath()
"GDAL_FILENAME_IS_UTF8" : "NO"
}
sep = os.pathsep

View File

@ -199,15 +199,14 @@ class GdalToolsBaseDialog(QDialog, Ui_Dialog):
return
if self.command.find( "gdalinfo" ) != -1 and exitCode == 0:
print "*** DEBUG ***"
self.emit( SIGNAL("finished(bool)"), self.loadCheckBox.isChecked() )
self.stop()
return
# show the error message if there's one, otherwise show the process output message
msg = QString(self.process.readAllStandardError())
msg = QString.fromLocal8Bit(self.process.readAllStandardError())
if msg.isEmpty():
outMessages = QString(self.process.readAllStandardOutput()).split( "\n" )
outMessages = QString.fromLocal8Bit(self.process.readAllStandardOutput()).split( "\n" )
# make sure to not show the help
for m in outMessages:

View File

@ -101,7 +101,7 @@ class GdalToolsDialog( QWidget, Ui_Widget, BasePluginWidget ):
arr = QByteArray()
arr = self.base.process.readAllStandardOutput()
if platform.system() == "Windows":
info = QString( arr ).trimmed().split( "\r\n" )
info = QString.fromLocal8Bit( arr ).trimmed().split( "\r\n" )
else:
info = QString( arr ).trimmed().split( "\n" )
self.rasterInfoList.addItems( info )

View File

@ -182,7 +182,7 @@ class GdalToolsDialog( QWidget, Ui_Widget, BaseBatchWidget ):
BasePluginWidget.onFinished(self, exitCode, status)
return
msg = QString( self.base.process.readAllStandardError() )
msg = QString.fromLocal8Bit( self.base.process.readAllStandardError() )
if not msg.isEmpty():
self.errors.append( ">> " + self.inFiles[self.batchIndex] + "<br>" + msg.replace( "\n", "<br>" ) )

View File

@ -112,7 +112,7 @@ class GdalToolsBaseBatchWidget(BasePluginWidget):
BasePluginWidget.onFinished(self, exitCode, status)
return
msg = QString( self.base.process.readAllStandardError() )
msg = QString.fromLocal8Bit( self.base.process.readAllStandardError() )
if not msg.isEmpty():
self.errors.append( ">> " + self.inFiles[self.batchIndex] + "<br>" + msg.replace( "\n", "<br>" ) )