[Seaside] download content & encoding

Sebastian Sastre sebastian at flowingconcept.com
Thu Nov 24 16:16:30 UTC 2011


Hi Johan,

if you deal only with ASCII, you are okay

the problem is seen when you have this:  
diacritics + uft8 encoding + excel

what happens is that excel opens the utf8 file with all the diacritics mangled.

Example:
"Descrição" is shown by excel as "Descrição"

I've tried the BOM header but it doesn't work on office for mac so I've just ecoded it in CP1252

sebastian

o/

PD: see here for details: 
http://stackoverflow.com/questions/155097/microsoft-excel-mangles-diacritics-in-csv-files


On Nov 24, 2011, at 1:20 PM, Johan Brichau wrote:

> Sebastian,
> 
> I noticed your question and, because we are also exporting csv but never seemed to bump into any encoding problem, I wonder if the following would not work for you.
> We are doing it like this:
> 
> html anchor
>    	callback: [self requestContext respond: [ :response |
> 							response 
> 								attachmentWithFileName: 'yesplan',Date today yyyymmdd,'.csv';
> 								contentType: (WAMimeType main: 'text' sub: 'csv');
> 								nextPutAll: (String streamContents: [:str | self exportCSVOn: str])]];
> 
> Works for you too?
> 
> cheers
> Johan
> 
> On 24 Nov 2011, at 14:52, Sebastian Sastre wrote:
> 
>> done.
>> 
>> It works.
>> 
>> Note that mime type is text/csv and it will answer false to #isBinary so it needed tweaking there
>> 
>> sebastian
>> 
>> o/
>> 
>> On Nov 23, 2011, at 7:06 PM, Lukas Renggli wrote:
>> 
>>> On 23 November 2011 21:38, Sebastian Sastre
>>> <sebastian at flowingconcept.com> wrote:
>>>> Hi guys,
>>>> setting an anchor to download a document encodes the content right?
>>>> there is a way to make seaside not to encode the document?
>>>> sebastian
>>>> o/
>>> 
>>> Set the response to binary.
>>> 
>>> Lukas
>>> 
>>> 
>>>> 
>>>> _______________________________________________
>>>> seaside mailing list
>>>> seaside at lists.squeakfoundation.org
>>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Lukas Renggli
>>> www.lukas-renggli.ch
>>> _______________________________________________
>>> 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
> 
> _______________________________________________
> 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/20111124/bc8b30b2/attachment.htm


More information about the seaside mailing list