[Seaside] utf-8 response conversion

Pavel Krivanek squeak3 at continentalbrno.cz
Sun Apr 10 10:24:50 CEST 2005


How I wrote a few days later, Seaside doesn't work well with MultiStrings in
Squeak 3.8. The resultant page will totally break in version 2.5b and the
special multibyte characters are replaced with query mark in version 2.6a.
We may convert the content of components in WAAbstractHtmlBuilder
class>>encode: but we still have problems in MultiStrings in updateRoot:
(title:) or in form entries. My solution is to convert whole response in
WAKom>>process: or in WAKom>>convertResponse:


WAKom >> process: komRequest

 | request response komResponse stream |

 self log: komRequest.
 request := self convertRequest: komRequest.

 response := self handleRequest: request.
 komResponse := self convertResponse: response.

 stream := MultiByteBinaryOrTextStream on:  MultiString new encoding: #utf8.
 stream nextPutAll: komResponse contents.
 komResponse contents: stream binary reset contents readStream.

 response release.

 ^ komResponse


-- Pavel



More information about the Seaside mailing list