[Seaside-dev] Re: encoded stream

Philippe Marschall philippe.marschall at gmail.com
Sat Jan 24 17:18:32 UTC 2009


2009/1/24, Julian Fitzell <jfitzell at gmail.com>:
> (moving this to the list)
>
> On Sat, Jan 24, 2009 at 3:16 PM, Lukas Renggli <renggli at gmail.com> wrote:
>> On Sat, Jan 24, 2009 at 1:14 PM, Julian Fitzell <julian at fitzell.ca>
>> wrote:
>>> Philippe says the decoding needs to be done based on the same setting
>>> as the encoding (makes sense) so if we are encoding based on an
>>> Application setting, we need to be decoding based on the same setting.
>>> I guess this means putting raw data in the Request object and
>>> specifying a Codec when you read from it (or just configuring it with
>>> one as it goes by so things further down the handling pipeline use
>>> that encoding automatically). All seems a little gross...
>>
>> Then I wonder why is there a char-set setting in the application at
>> all? Is there a reason to set it to something different than the
>> server adaptor?
>
> As best as I can understand, the Codec is supposed to be a
> configuration of what the encoding is *guaranteed* to be and the
> setting in the Application is what encoding is *reported*. By
> specifying a NullCodec, you are making no guarantee (you just give and
> take whatever the data is), but still might want to report that it is
> UTF-8 because that's what you think it is and you're going to just
> deal with it not working if not.

That's correct.

> Personally, though, while I sort of understand the logic behind this,
> I think this is a major source of confusion for people (it certainly
> is for me). And since we don't know for sure most of the time what
> encoding is used in a request, it isn't really a guarantee anyway.
> ...
> Thoughts?

I'm all in favor of reducing confusion. However I would prefer
something simple than a super generic approach that allows you to
configure everything when in the end you only have two different
scenarios. These two are you want conversion from an external encoding
to Smalltalk or you want to use your external encoding as your
internal one. so your internal encoding can be either Smalltalk or
your external one.

Cheers
Philippe


More information about the seaside-dev mailing list