[Seaside] download content & encoding

Johan Brichau johan at inceptive.be
Thu Nov 24 16:24:53 UTC 2011


Indeed. 

FYI: you need UTF16 with tab separation instead of commas to make it work cross platform. 


Johan (sent from my mobile)

On 24 Nov 2011, at 17:16, Sebastian Sastre <sebastian at flowingconcept.com> wrote:

> 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
> 
> _______________________________________________
> 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/f83de45a/attachment-0001.htm


More information about the seaside mailing list