Skip to content

Commit

Permalink
fix issues with non-ASCII filenames in GDALTools, thanks to Evgenia for
Browse files Browse the repository at this point in the history
pointing on this problem
  • Loading branch information
alexbruy committed Feb 11, 2013
1 parent dd1bb45 commit 8970a1f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions python/plugins/GdalTools/tools/GdalTools_utils.py
Expand Up @@ -802,6 +802,7 @@ def setProcessEnvironment(process):
envvar_list = {
"PATH" : getGdalBinPath(),
"PYTHONPATH" : getGdalPymodPath()
"GDAL_FILENAME_IS_UTF8" : "NO"
}

sep = os.pathsep
Expand Down
5 changes: 2 additions & 3 deletions python/plugins/GdalTools/tools/dialogBase.py
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/tools/doInfo.py
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/tools/doOverview.py
Expand Up @@ -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>" ) )

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/tools/widgetBatchBase.py
Expand Up @@ -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>" ) )

Expand Down

0 comments on commit 8970a1f

Please sign in to comment.