[Seaside-dev] Issue 287 in seaside: encoding code

codesite-noreply at google.com codesite-noreply at google.com
Wed Jan 21 15:55:06 UTC 2009


Status: Accepted
Owner: ----
Labels: Type-CleanUp Priority-Medium Version-Seaside2.9

New issue 287 by jfitzell: encoding code
http://code.google.com/p/seaside/issues/detail?id=287

WAUrlEncoder gets the codec from the request context. This works but feels
tacky as it depends on the #use:during: wrapper but might be used by many
handlers that don't, otherwise, need to do this. It would be better to pass
a codec in on initialization.

This is all a bit confusing but I *think* I have it worked out. I suggest
fixing this as part of a larger refactoring (not sure how this overlaps
with what Lukas is up to with Response):

+ Add a codec instvar to WAHtmlDocument and create a constructor that takes
both a Stream and a Codec. These can be used to initialize the Encoders it
requires.

+ Replace WAEntryPoint>>newDocumentOn: with WARequestContext>>newDocument.
This method can try to get the correct Document class from an EntryPoint or
use a default if none is found. It can then pass in the correct Codec and
the Stream from the Response into the Document.

+ WAHtmlEncoder is responsible for writing html-encoded *AND* character
encoded data to the stream (I think this is already the case). This is
really the only thing that works because it is the only place that knows
whether the data being written is a URL or not and URL encoding is done
*after* character encoding.

Comments appreciated.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


More information about the seaside-dev mailing list