Message1997
Hello,
Thanks for very useful tool!
I've found my Microsoft Excel file doesn't understand a
CSV file generated by Roundup. It's because I've
configured Roundup to use utf-8 and the Excel doesn't
understand the utf-8.
I've patched up small amount of code as follows.
cgi/actions.py
import codecs
<snip>
class ExportCSVAction(Action):
<snip>
def handle(self):
<snip>
encoding = request.form.getvalue('encoding')
<snip>
# writer = csv.writer(self.client.request.wfile)
wf = self.client.request.wfile
if encoding:
try:
wf =
codecs.EncodedFile(self.client.request.wfile, 'utf-8',
encoding, 'replace')
except:
pass
writer = csv.writer(wf)
<snip>
So, &encoding=mbcs will work for my environment (or
ms932 in JapaneseCodecs installed). For example,
html/issue.index.html
<a tal:attributes="href
python:request.indexargs_url('issue',
{'@action':'export_csv','encoding':
'ms932'})" i18n:translate="">Download as CSV</a>
I hope it's useful for you all.
|
|
Date |
User |
Action |
Args |
2009-02-03 14:21:25 | admin | link | issue1240848 messages |
2009-02-03 14:21:25 | admin | create | |
|