[Seaside] download content & encoding

Sebastian Sastre 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!

sebastian

o/



On Nov 25, 2011, at 7:35 AM, Johan Brichau wrote:

> Sebastian,
> 
> 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
> Johan
> 
> 
> 
> 							response
> 								attachmentWithFileName: 'nextplan',Date today yyyymmdd,'.csv';
> 								contentType: ((WAMimeType main: 'text' sub: 'csv')
> 											charset: 'utf-16');
> 								binary.
> 								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
>> 
>> sebastian
>> 
>> o/
>> 
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20111125/535772aa/attachment.htm


More information about the seaside mailing list