mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
applied fix for #6127 (problems with non-ascii strings
This commit is contained in:
parent
6302751392
commit
abbe25f920
@ -60,7 +60,12 @@ class LayerExporter():
|
|||||||
del writer
|
del writer
|
||||||
return output
|
return output
|
||||||
else:
|
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() )
|
writer = QgsVectorFileWriter( output, systemEncoding,provider.fields(), provider.geometryType(), provider.crs() )
|
||||||
feat = QgsFeature()
|
feat = QgsFeature()
|
||||||
while provider.nextFeature(feat):
|
while provider.nextFeature(feat):
|
||||||
|
@ -76,12 +76,8 @@ class SagaUtils:
|
|||||||
fout.write("PATH=PATH;%SAGA%;%SAGA_MLB%\n");
|
fout.write("PATH=PATH;%SAGA%;%SAGA_MLB%\n");
|
||||||
else:
|
else:
|
||||||
pass
|
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:
|
for command in commands:
|
||||||
fout.write("saga_cmd " + command + "\n")
|
fout.write("saga_cmd " + command.encode("utf8") + "\n")
|
||||||
|
|
||||||
fout.write("exit")
|
fout.write("exit")
|
||||||
fout.close()
|
fout.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user