[Seaside] download content & encoding
sebastian at flowingconcept.com
Fri Nov 25 12:02:21 UTC 2011
yes yes it worked at first try. I used to have semicolons as separators but tabs are a better default from the excel's expectation POV.
The usability result is one double click vs. a double click plus a wizard with 3 steps
so tabs won hands down :)
again, great tip, thanks!
On Nov 25, 2011, at 7:35 AM, Johan Brichau wrote:
> I even have code for it that should work in Pharo (see below).
> I had it in comments in our application code because it does not work in Gemstone (no utf16 encoder).
> But if I remember correctly, this works for cross-platform csv import in Excel. Just mind that you need to use tabs to separate the fields instead of commas (or semicolons ;-)
> Hope this helps
> attachmentWithFileName: 'nextplan',Date today yyyymmdd,'.csv';
> contentType: ((WAMimeType main: 'text' sub: 'csv')
> charset: 'utf-16');
> converter := UTF16TextConverter new useLittleEndian: true; useByteOrderMark: true.
> response nextPutAll: ((String streamContents: [:str |
> self exportCSVFor: coll on: str]) convertToWithConverter: converter) asByteArray]];
> On 24 Nov 2011, at 18:08, Sebastian Sastre wrote:
>> On Nov 24, 2011, at 2:24 PM, Johan Brichau wrote:
>>> you need UTF16 with tab separation instead of commas to make it work cross platform.
>> ha! nice one
>> thanks for that tip
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside