[Seaside] download content & encoding

Johan Brichau johan at inceptive.be
Fri Nov 25 09:35:30 UTC 2011


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



More information about the seaside mailing list