[Seaside] Accent in generated pages
Sven Van Caekenberghe
sven at stfx.eu
Wed Jun 17 20:10:35 UTC 2015
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
More information about the seaside
mailing list