[Seaside] Accent in generated pages

Alexandre Bergel alexandre.bergel at me.com
Wed Jun 17 21:29:33 UTC 2015


Ah okay!

Last quick question (I hope :-)

How to automatically add this "<?xml version="1.0" encoding="UTF-8”?>” in front of the generated file? Should I use a new WAHtmlRoot? Or an WAHtmlAttributes? Or plugging somewhere an WAEncoder?

Thanks Sven, this is really helpful!

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



> On Jun 17, 2015, at 5:59 PM, Sven Van Caekenberghe <sven at stfx.eu> wrote:
> 
>> 
>> On 17 Jun 2015, at 22:48, Alexandre Bergel <alexandre.bergel at me.com> wrote:
>> 
>>> $ cat /tmp/test.html 
>>> <html><head><title></title></head><body onload="onLoad()">Ñuñoa<script type="text/javascript">/*<![CDATA[*/function onLoad(){};/*]]>*/</script></body></html>
>>> 
>>> $ file /tmp/test.html 
>>> /tmp/test.html: HTML document text
>> 
>> Okay, but I am opening test.html within Safari, then accents are not shown.
>> You pointed me on these codec, but I see none related to string accent conversion.
>> 
>> I have seen the class WAUrlEncoder, but this is for URL. 
>> | w |
>> w := WriteStream on: String new.
>> 'Ñuñoa' do: [ :c |
>> 	WAUrlEncoder encode:  c on: w ].
>> w contents
>> 
>> =>  '%D1u%F1oa’
>> 
>> I need something like that but for html code.
>> 
>> I tried also
>> 'Ñuñoa'  encodeOn:   WAXmlDocument new
>> But no, I do not get something that starts with: '&Ntilde;u…'
>> 
>> Any idea?
> 
> Yes, I just don't know why it does not work in Seaside, normally special characters should just work, no need to do anything special.
> 
> What needs to be added is 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> in front of the .html, like:
> 
> $ cat /tmp/test.html 
> <?xml version="1.0" encoding="UTF-8"?><html><head><title></title></head><body onload="onLoad()">Ñuñoa<script type="text/javascript">/*<![CDATA[*/function onLoad(){};/*]]>*/</script></body></html>
> 
> When opening an HTML file locally, there is no mime-type added by the server, hence the browser does not know the encoding.
> 
> Here is another live example (independent of Seaside):
> 
> http://zn.stfx.eu/unicode <http://zn.stfx.eu/unicode>
> 
>> Alexandre
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org <mailto:seaside at lists.squeakfoundation.org>
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside <http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org <mailto:seaside at lists.squeakfoundation.org>
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside <http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20150617/288f4d99/attachment.htm


More information about the seaside mailing list