[Seaside] character encoding / was: (Postgres / Glorp / Kom)

Lukas Renggli renggli at gmail.com
Tue May 15 05:30:20 UTC 2007


> Philippe
> Basically informs us that the handling of UTF8 strings in KomHttpServer /
> Squeak 3.9 got really broken, and that sadly the fix seems not to be on the
> way anytime soon.  But also says that everything works in 3.8.
> In spite of this affirmation, I got no concrete answers from anyone using
> Seaside in production (and using special characters) about which platform
> are they using.  In particular, I didn't hear from the rest of the Seaside
> core developers "We are all using Squeak 3.8" nor I have the fix for
> KomHttpServer for 3.9 but I will not share it :)

No, all the Seaside applications I am working on run on top of 3.9 and
most of them include quite a bunch of strange (German, French, Korean,
Japanese) characters. To get it working I follow these principles:

1. In Kom Philippe patched: #decodeUrlEncodedFrom:multipleValues: and
#initialStatusString: to send unescapePercentsWithTextEncoding:
'latin-1' instead of just unescapePercents.

2. All XHTML pages are sent using UTF-8, avoiding a slow and error
prone transformation.

3. All the data inside the model is UTF-8, this means some string
operations do not work (e.g. #size might return something wrong) but
that doesn't matter much in my case.

4. All literal strings have to be converted to UTF-8 by sending
#latinToUtf8. For exisiting application this can be easily patched
using the RewriteEditor.

All in all it is quite ugly, but it works fast and reliable. I don't
have enough knowledge on character encodings to provide a better
solution. Unfortunately Kom is a dead project and nobody is willing to
fix it.

Hope this helps,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside mailing list