[Seaside] Accent in generated pages

Alexandre Bergel alexandre.bergel at me.com
Wed Jun 17 20:18:47 UTC 2015


Thanks!
But the problem remains I fear.

	| fullDocument canvas |
	canvas := WAHtmlCanvas builder.
	canvas fullDocument: true.
	canvas rootClass: ABHtmlRoot.
	fullDocument :=  canvas render: [ :html | 
		html text: 'Ñuñoa'

		 ].
	 '/tmp/test.html' asFileReference writeStreamDo: [ :out | out << fullDocument ].
	
Opening test.html gave me: Ñuñoa

I guess I should generate the html code for the accentued characters. But I guess there is something already in Seaside right?

Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



> On Jun 17, 2015, at 5:10 PM, Sven Van Caekenberghe <sven at stfx.eu> wrote:
> 
> Alex,
> 
> Try:
> 
> '/tmp/test.html' asFileReference writeStreamDo: [ :out | out << 'Ñuñoa' ].
> '/tmp/test.html' asFileReference contents.
> 
> prometheus:Smalltalk sven$ file /tmp/test.html 
> /tmp/test.html: UTF-8 Unicode text, with no line terminators
> prometheus:Smalltalk sven$ cat /tmp/test.html 
> Ñuñoa
> 
> The streams created above do the proper (utf-8) encoding, the ones in your example do not.
> 
> HTH,
> 
> Sven
> 
>> On 17 Jun 2015, at 21:05, Alexandre Bergel <alexandre.bergel at me.com> wrote:
>> 
>> Hi!
>> 
>> I am migrating code from Amber to Pharo, and I am facing a problem with the accent. Consider the following example:
>> 
>> 	| fullDocument fs canvas |
>> 	canvas := WAHtmlCanvas builder.
>> 	canvas fullDocument: true.
>> 	canvas rootClass: ABHtmlRoot.
>> 	fullDocument :=  canvas render: [ :html | 
>> 		html text: 'Ñuñoa'
>> 
>> 		 ].
>> 	fs  := FileStream forceNewFileNamed: '/tmp/test.html'.
>> 	fs nextPutAll: fullDocument.
>> 	fs close.
>> 
>> Opening the file in a web browser shows me: Ñuñoa
>> 
>> Is there a way to prevent this? 
>> 
>> Cheers,
>> Alexandre
>> 
>> -- 
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>> 
>> 
>> 
>> _______________________________________________
>> 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



More information about the seaside mailing list