On Tuesday, March 11, 2003, at 01:34 PM, Bruno Dumon wrote:


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?


As far as I can tell, yes it did solve it. I was making only one change at a time, after this one, it worked ;)

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.


Interesting


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


Hmmm


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)?



Yes, this is a better technique.
I had an idea there may be a configuration here, but could not find an example of it.


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



Yep


 * 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)


Good to know


 * 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.

Lets put the config in, it will make it easier for other to see what to change. We work exclusively in UTF-8 for instance.


I find it very strange that ISO-8859-1 should be the standard (how parochially European ;) surely in this day and age it should be UTF-8. ;)

BTW. While I was searching Cocoon's codebase looking for code that sets up encodings, I found a FIXME in SQLTransformer, that makes the un-configurable assumption that ISO-8859-1 is the encoding of your DB.

I have been meaning to find time to make this configurable.


thanks for the feedback


regards Jeremy



Reply via email to