[Seaside] Special chars (euro-sign) and umlauts in Seaside

Adrian Schmitt adrian.schmitt at googlemail.com
Sun Nov 19 19:20:38 UTC 2006


Hi,

I was trying today to produce the euro sign € on seaside output.
And I have also text to display with umlauts and french characters
like e-accent-aigu.

I found out I could patch WAAbstractHtmlBuilder in seaside-builder.
This is what the initialize method now looks like:

<code>
initialize
"WAHtmlBuilder initialize"
HtmlCharacters _ Array new: 256.
0 to: 255 do: [:ea | HtmlCharacters at: ea + 1 put: ea asCharacter].
#($" 'quot' $< 'lt' $& 'amp' $> 'gt'
  $ä 'auml' $ö 'ouml' $ü 'uuml' $Ä 'Auml' $Ö 'Ouml' $Ü 'Uuml' $ß 'szlig'
  $è 'egrave' $é 'eacute'
  $€; 'euro') pairsDo:
   [:c :s | HtmlCharacters at: (c asInteger + 1) put: ('&',s,';') ]
</code>

To activate it I had to run "WAAbstractHtmlBuilder initialize" in a
workspace. Now I can type in all the characters mentioned above into
seaside directly.

It could be that some of the chars in the code above don't make the
way from my editor to your desktop. But you could edit the array and
correct or insert just the characters and codes you need. I found a
list here, just scroll down to see the tables:

http://de.selfhtml.org/html/referenz/zeichen.htm

Does anyone know a better way to do what I did? How is
internationalisation handled in squeak? What if I get text for display
from databases in different character-sets, how do I convert it the
"seaside way" for correct html output?

Adrian


More information about the Seaside mailing list