Skip to content

Commit

Permalink
applied fix for #6127 (problems with non-ascii strings
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Nov 15, 2012
1 parent 6302751 commit abbe25f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 6 additions & 1 deletion python/plugins/sextante/core/LayerExporter.py
Expand Up @@ -60,7 +60,12 @@ def exportVectorLayer(layer):
del writer
return output
else:
if (not unicode(layer.source()).endswith("shp")):
isASCII=True
try:
unicode(layer.source()).decode("ascii")
except UnicodeEncodeError:
isASCII=False
if (not unicode(layer.source()).endswith("shp") or not isASCII):
writer = QgsVectorFileWriter( output, systemEncoding,provider.fields(), provider.geometryType(), provider.crs() )
feat = QgsFeature()
while provider.nextFeature(feat):
Expand Down
6 changes: 1 addition & 5 deletions python/plugins/sextante/saga/SagaUtils.py
Expand Up @@ -76,12 +76,8 @@ def createSagaBatchJobFileFromSagaCommands(commands):
fout.write("PATH=PATH;%SAGA%;%SAGA_MLB%\n");
else:
pass
#fout.write("export SAGA_MLB=" + SagaUtils.sagaPath() + os.sep + "modules" + "\n");
#fout.write("PATH=$PATH:" + SagaUtils.sagaPath() + os.sep + "modules" + "\n");
#fout.write("export PATH\n");

for command in commands:
fout.write("saga_cmd " + command + "\n")
fout.write("saga_cmd " + command.encode("utf8") + "\n")

fout.write("exit")
fout.close()
Expand Down

0 comments on commit abbe25f

Please sign in to comment.