cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: form encoding problems
Date Tue, 11 Mar 2003 13:34:14 GMT
On Mon, 2003-03-03 at 23:00, Jeremy Quinn wrote:
[...]
> I have got it. This was answered on the users list a while back, sorry 
> guys.
> 
> Answer, use the SetCharacterEncodingAction in the Pipeline.
> 
> Works with InputModules too.

(a bit late to jump into this thread)

Are you sure that it was adding this action that solved your problem?

I'm wondering how the SetCharacterEncodingAction could actually do
anything useful. According to the servlet spec (I'm looking at version
2.3), the request.setCharacterEncoding method only does something if
called before any data is read from the request.

Since Cocoon itself reads parameters from the request (such as
cocoon-reload) before any action is executed, this action obviously
cannot do anything useful?

Wouldn't it be better if we logged a big warning in this action pointing
to the container/form-encoding parameters in the web.xml (and the same
in its javadoc)?

As for the correct way to do things, this is what I understand from it:

 * set the encoding of the HTML serializer to the encoding you'd like to
use

 * make sure a <head> element exists in the html you generate, so that
the serializer can add a <meta ... tag into it (from Stefano's
experiments, this does not seem to work with the xhtml serializer)

 * in the web.xml: set container-encoding to ISO-8859-1 (don't know why
its configurable because it should be ISO-8859-1 per spec), and set
form-encoding to the same encoding of the serializer.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Mime
View raw message