Skip to content
Permalink
Browse files
fix issues with non-ASCII filenames in GDALTools, thanks to Evgenia for
pointing on this problem
  • Loading branch information
alexbruy committed Feb 11, 2013
1 parent dd1bb45 commit 8970a1fde543e606b21c57a9814bc82bf83fc177
@@ -802,6 +802,7 @@ def setProcessEnvironment(process):
envvar_list = {
"PATH" : getGdalBinPath(),
"PYTHONPATH" : getGdalPymodPath()
"GDAL_FILENAME_IS_UTF8" : "NO"
}

sep = os.pathsep
@@ -199,15 +199,14 @@ def onFinished(self, exitCode, status):
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:
@@ -101,7 +101,7 @@ def finished( self ):
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 )
@@ -182,7 +182,7 @@ def onFinished(self, exitCode, status):
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>" ) )

@@ -112,7 +112,7 @@ def onFinished(self, exitCode, status):
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>" ) )

0 comments on commit 8970a1f

Please sign in to comment.