Roundup Tracker - Issues

Message1997

Author anonymous
Recipients
Date 2005-07-19.13:47:04
Message-id
In-reply-to
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.
History
Date User Action Args
2009-02-03 14:21:25adminlinkissue1240848 messages
2009-02-03 14:21:25admincreate