One step closer to proving the issue:

The preInit method reads the properties in order listed below. It is which loads all classpath properties file in the array ‘resources’ as presented below.

As you can see the file gets loaded at the end overwriting my own property. I think the best solution would be to actually remove that property from and let the developer decide himself declaring that value.






From: Robby Pelssers []
Sent: Wednesday, June 06, 2012 1:27 PM
Subject: RE: issue with form encoding C2.2


Hi Javier,


I read about default encoding for using GET, but I’m actually ‘posting’ the form.  I really am convinced that the only real issue here is that the formencoding property ‘org.apache.cocoon.formencoding’ is being set with the value from the cocoon-core block.  I’m currently debugging the spring configurator and I suspect this will confirm the issue.  Will get back on this today.




From: Javier Puerto []
Sent: Wednesday, June 06, 2012 1:23 PM
Subject: Re: issue with form encoding C2.2


Hi Robby,

Maybe it's helps, by default Tomcat uses ISO-8859-1 for URL encoding so GET parameters will be affected.
We had similar issues before and was fixed configuring the Tomcat connector as UTF-8.


2012/6/6 Robby Pelssers <>

I did found a workaround by the way…


If you add an extra request parameter called cocoon-form-encoding and set it to utf-8 it will work


Snippet from


    protected Environment getEnvironment(String uri,

                                         HttpServletRequest req,

                                         HttpServletResponse res)

    throws Exception {


        String formEncoding = req.getParameter("cocoon-form-encoding");

        if (formEncoding == null) {

            formEncoding = this.settings.getFormEncoding();



        HttpEnvironment env;

        env = new HttpEnvironment(uri,







        return env;



From: Robby Pelssers []
Sent: Wednesday, June 06, 2012 1:10 PM
Subject: issue with form encoding C2.2


Hi all,


Just wanted to have a short discussion on an issue that I wasted quite some hours on.  Let me first explain that I configured my cocoon block with following two properties as per :






Recently I created a form showing pre-populated data from an xquery.  One form field contained the Ohm Ω character and the browser rendered if fine.  But I had to post the data back to the server and the Ohm sign got corrupted.


From firebug I could see following:

descriptiveTitle N-channel 25 V 2.85 mΩ logic level MOSFET in LFPAK using NextPower technology

magCode             R73

specificationStatus          Product


From flowscript:

descriptiveTitle=N-channel 25 V 2.85 mΩ logic level MOSFET in LFPAK using NextPower technology






So next I started looking at cocoon sources using URLDecoder and I had a suspicion that NetUtils might be responsible for the issue. But that didn’t seem to be the issue.  I managed to find out that the value I defined for formencoding is not actually used.  The reason is that it also is set in cocoon-core and either it doesn’t get overwritten or the property from cocoon-core is overwriting my own property value.


nxp10009@NXL01262 /c/development/workspaces/cocoon22/trunk/core

$ find . -name *.properties | xargs grep "formencoding"



So what’s the best way to fix this?