make encoding configurable
This commit is contained in:
parent
a565d750e3
commit
f6f266acb5
1 changed files with 11 additions and 1 deletions
|
@ -22,6 +22,7 @@ View classes for export of report results.
|
||||||
|
|
||||||
import csv
|
import csv
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope.i18n import translate
|
from zope.i18n import translate
|
||||||
|
|
||||||
from loops.common import normalizeName
|
from loops.common import normalizeName
|
||||||
|
@ -36,7 +37,16 @@ class ResultsConceptCSVExport(ResultsConceptView):
|
||||||
reportMode = 'export'
|
reportMode = 'export'
|
||||||
|
|
||||||
delimiter = ';'
|
delimiter = ';'
|
||||||
encoding = 'UTF-8'
|
#encoding = 'UTF-8'
|
||||||
|
#encoding = 'ISO8859-15'
|
||||||
|
#encoding = 'CP852'
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
def encoding(self):
|
||||||
|
enc = self.globalOptions('csv_encoding')
|
||||||
|
if enc:
|
||||||
|
return enc[0]
|
||||||
|
return 'UTF-8'
|
||||||
|
|
||||||
def getFileName(self):
|
def getFileName(self):
|
||||||
return normalizeName(self.context.title)
|
return normalizeName(self.context.title)
|
||||||
|
|
Loading…
Add table
Reference in a new issue