Skip to content
Permalink
Browse files

[processing] correctly write html output in utf-8

  • Loading branch information
alexbruy committed Jan 8, 2016
1 parent acf7493 commit 8d2f7bb2eedcef065c594753de287d767047a47e
@@ -26,6 +26,7 @@
__revision__ = '$Format:%H$'

import math
import codecs

from qgis.core import QgsStatisticalSummary
from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -178,7 +179,11 @@ def processAlgorithm(self, progress):
self.setOutputValue(self.IQR, iqr)

def createHTML(self, outputFile, algData):
f = open(outputFile, 'w')
f = codecs.open(outputFile, 'w', encoding='utf-8')
f.write('<html><head>')
f.write('<meta http-equiv="Content-Type" content="text/html; \
charset=utf-8" /></head><body>')
for s in algData:
f.write('<p>' + unicode(s) + '</p>')
f.write('</body></html>')
f.close()
@@ -26,6 +26,7 @@
__revision__ = '$Format:%H$'

import math
import codecs
from qgis.core import QgsFeatureRequest, QgsFeature, QgsDistanceArea
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterVector
@@ -115,7 +116,11 @@ def processAlgorithm(self, progress):
self.setOutputValue(self.Z_SCORE, float(data[4].split(': ')[1]))

def createHTML(self, outputFile, algData):
f = open(outputFile, 'w')
f = codecs.open(outputFile, 'w', encoding='utf-8')
f.write('<html><head>')
f.write('<meta http-equiv="Content-Type" content="text/html; \
charset=utf-8" /></head><body>')
for s in algData:
f.write('<p>' + unicode(s) + '</p>')
f.write('</body></html>')
f.close()
@@ -26,6 +26,7 @@
__revision__ = '$Format:%H$'

import math
import codecs

from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterRaster
@@ -114,7 +115,11 @@ def defineCharacteristics(self):
self.addOutput(OutputNumber(self.STD_DEV, self.tr('Standard deviation')))

def createHTML(self, outputFile, algData):
f = open(outputFile, 'w')
f = codecs.open(outputFile, 'w', encoding='utf-8')
f.write('<html><head>')
f.write('<meta http-equiv="Content-Type" content="text/html; \
charset=utf-8" /></head><body>')
for s in algData:
f.write('<p>' + unicode(s) + '</p>')
f.write('</body></html>')
f.close()

0 comments on commit 8d2f7bb

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