Skip to content
Permalink
Browse files

Merge pull request #7307 from rldhont/processing-r-enconde-string-218

[Bugfix][Processing] R script: ParameterString has to be encoding
  • Loading branch information
m-kuhn committed Jun 25, 2018
2 parents 294f8ac + 70e0395 commit 87e93c11c78158434793450ace860085b27b1d31
Showing with 10 additions and 1 deletion.
  1. +10 −1 python/plugins/processing/algs/r/RAlgorithm.py
@@ -27,6 +27,7 @@

import os
import json
import types

from qgis.PyQt.QtGui import QIcon

@@ -499,12 +500,20 @@ def getImportCommands(self):
commands.append(param.name + '= NULL')
else:
commands.append(param.name + ' = "' + param.value + '"')
elif isinstance(param, (ParameterTableField, ParameterTableMultipleField, ParameterString,
elif isinstance(param, (ParameterTableField, ParameterTableMultipleField,
ParameterFile)):
if param.value is None:
commands.append(param.name + '= NULL')
else:
commands.append(param.name + '="' + param.value + '"')
elif isinstance(param, ParameterString):
if param.value is None:
commands.append(param.name + '= NULL')
elif type(param.value) == types.StringType:
commands.append(param.name + '="' + param.value + '"')
else:
c = unicode(param.name) + u'="' + unicode(param.value) + u'"'
commands.append(c.encode('utf8'))
elif isinstance(param, (ParameterNumber, ParameterSelection)):
if param.value is None:
commands.append(param.name + '= NULL')

0 comments on commit 87e93c1

Please sign in to comment.
You can’t perform that action at this time.