cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bert Van Kets <>
Subject Re: [SUMMARY] Encoding form data
Date Mon, 28 Oct 2002 14:15:26 GMT
Don't get this wrong.  You needn't add the action in every pipeline, just 
in the ones that capture form data where you can expect non-ASCII characters.

Thanks for the addition.


At 14:59 28/10/2002 +0100, you wrote:
>If somebody implements the database-actions like in the 

>it is
>possible to include the set-encoding action into the 
><map:action-sets/>-section instead of including it into every pipeline.
>fragment from cocoon/sitemap.xmap with the additional map:act-element
>  <map:action-sets>
>   <map:action-set name="employee">
>    <map:act type="set-encoding">
>     <map:parameter name="form-encoding" value="UTF-8"/>
>    </map:act>
>    <map:act action="Add" type="add-employee"/>
>    <map:act action="Delete" type="del-employee"/>
>    <map:act action="Update" type="upd-employee"/>
>   </map:action-set>
>  </map:action-sets>
>----- Original Message -----
>From: <>Bert Van Kets
>To: <>
>Sent: Monday, October 28, 2002 1:48 PM
>Subject: [SUMMARY] Encoding form data
>Cocoon does not support non-US characters when posting data to the server.
>Characters like รจ (e accent grave) are translated to two strange characters
>when  checking the posted data.
>iso-8859-1 is the default encoding for Cocoon and it does support all
>necessary West European characters (thanks to Bruno for pointing this
>out).  You can find out more on iso-8859-1 on
>If you need support for other characters you will need to replace
>iso-8859-1 with UTF-8 which has Unicode support.  More on UTF can be found
>When you create a webform and post to a pipeline that has a request
>generator and an XML serializer you will see that posted data is not
>correctly presented.  To correct this you need to add the
>request.setCharacterEncoding method to set the encoding for the request
>data.  This method is captured in the setCharacterEncodignAction action.
>To use it simply add
><map:action name="set-encoding"
>to the action component block
>Then add this at the beginning of every pipeline that catches requested
>non-ASCII data
>          <map:act type="set-encoding">
>            <map:parameter name="form-encoding" value="iso-8859-1"/>
>          </map:act>
>Of course you need to replace "iso-8859-1" with "UTF-8" if you need to use
>that encoding.
>Another important thing is that you must make sure the data is sent out to
>the browser with the correct encoding in the first place.  To achieve this
>add the encoding to the XML and the (x)html serializers.
><map:serializer mime-type="text/html" name="html"
>src="org.apache.cocoon.serialization.HTMLSerializer" pool-grow="4"
>pool-max="32" pool-min="4" logger="sitemap.serializer.html">
>     <buffer-size>1024</buffer-size>
>     <encoding>iso-8859-1</encoding>
>This should do it!
>Have fun.
>This mail is written in 100% recycled electrons.
>Please check that your question  has not already been answered in the
>FAQ before 
>To unsubscribe, 

>For additional commands, 

Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message