[Seaside] Encoding on saving html file

Johan Brichau johan at inceptive.be
Sat Oct 17 15:26:19 UTC 2015

You might want to look at [1] for a related discussion about this issue.

Instead of getting the stream contents from your context and saving that, try the following:

	| fullDocument |
	fullDocument := WAHtmlCanvas builder 
		fullDocument: true;
		rootBlock: [:root | root meta contentType: (WAMimeType textHtml charset:'utf-8') ];
		render: [ :html | html text: 'Ñuñoa' ].
	 '/tmp/test.html' asFileReference writeStreamDo: [ :out | out << fullDocument ].

If you really want to create a text file, how are you saving and viewing that text file once you get the contents from a Seaside document?


> On 17 Oct 2015, at 16:44, Stephan Eggermont <stephan at stack.nl> wrote:
> On 17/10/15 15:46, Dave wrote:
>> But if you save the text of my previous email to an html file and open it, it
>> shows "perché" instead of "perché"
> That depends on how you save it.
> You probably want to use an UTF8TextConverter somewhere
> It is used in MultiByteBinaryOrTextStream class>>on:encoding:
> Stephan
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the seaside mailing list