Skip to content

Commit abbe25f

Browse files
committed
applied fix for #6127 (problems with non-ascii strings
1 parent 6302751 commit abbe25f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

python/plugins/sextante/core/LayerExporter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ def exportVectorLayer(layer):
6060
del writer
6161
return output
6262
else:
63-
if (not unicode(layer.source()).endswith("shp")):
63+
isASCII=True
64+
try:
65+
unicode(layer.source()).decode("ascii")
66+
except UnicodeEncodeError:
67+
isASCII=False
68+
if (not unicode(layer.source()).endswith("shp") or not isASCII):
6469
writer = QgsVectorFileWriter( output, systemEncoding,provider.fields(), provider.geometryType(), provider.crs() )
6570
feat = QgsFeature()
6671
while provider.nextFeature(feat):

python/plugins/sextante/saga/SagaUtils.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,8 @@ def createSagaBatchJobFileFromSagaCommands(commands):
7676
fout.write("PATH=PATH;%SAGA%;%SAGA_MLB%\n");
7777
else:
7878
pass
79-
#fout.write("export SAGA_MLB=" + SagaUtils.sagaPath() + os.sep + "modules" + "\n");
80-
#fout.write("PATH=$PATH:" + SagaUtils.sagaPath() + os.sep + "modules" + "\n");
81-
#fout.write("export PATH\n");
82-
8379
for command in commands:
84-
fout.write("saga_cmd " + command + "\n")
80+
fout.write("saga_cmd " + command.encode("utf8") + "\n")
8581

8682
fout.write("exit")
8783
fout.close()

0 commit comments

Comments
 (0)