[Catalyst] CSV / UTF-8 / Unicode

Alexander Hartmaier alexander.hartmaier at t-systems.at
Tue Jul 2 17:32:31 GMT 2013

On 2013-07-02 19:26, Bill Moseley wrote:

On Tue, Jul 2, 2013 at 9:29 AM, Craig Chant <craig at homeloanpartnership.com<=
mailto:craig at homeloanpartnership.com>> wrote:
>> All the above seems overkill.   I suspect what you want is closer to thi=
s: (but see notes below).

Tried that, didn't work, ended up in a long Catalyst discussion where it wa=
s worked out that I needed to wrap any XLS output to an IO:FILE handle othe=
rwise Catalyst dies with an "out of memory" error something to do with stre=
aming data support issues in Catalyst so the work round is to wrap the outp=
ut into an IO:File object.

$xls is a scalar you have in memory of the comma separated value data?

>>Second, be aware that $c->response->content_length(length($xls));

Yes, I was doing the encode then using Length (I did read on perldocs about=
 requesting the length against the octet) , either way, the length was the =
least of my worries, keeping Catalyst from falling over with 'Wide Characte=
r' errors, or not getting garbage was my main concern.

And yes, the output is CSV not strictly XLS but I have been told and looked=
 it up on the net that 'application/vnd.ms-excel'  Is the correct MIME head=
er to pass for CSV that you want MS Excel to open.

http://www.ietf.org/rfc/rfc4180.txt, but how Windows decides how to open fi=
les is something I'm not familiar with.
That depends on the Browser setting per mime type and not the OS.
In Firefox you can define it in Preferences / Applications.

Bill Moseley
moseley at hank.org<mailto:moseley at hank.org>

List: Catalyst at lists.scsys.co.uk<mailto:Catalyst at lists.scsys.co.uk>
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
Notice: This e-mail contains information that is confidential and may be pr=
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20130702/51d43=

More information about the Catalyst mailing list