> > Use set-encoding action in your pipeline:
> > 
> >    <map:pipeline>
> >      <map:act type="set-encoding">
> >        <map:parameter name="form-encoding" value="utf-8"/>
> >      </map:act>
> >      ....
> >    </map:pipeline>


OK, I got it working now. Thank you for your hints!

For the small example:
I had to add "<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"/>" to the form generating pipe, so the HTML page was
interpreted as UTF-8. Only then the browser would send form data also as
UTF-8!


For my actual application:
As I am using SourceWritingTransformer I also had to set its
XMLSerializer to use UTF-8, as well as HTMLSerializer (otherwise the
browser would not sent the form data as UTF-8).

So what I found to work for me, is setting the encoding at four
different places:
o  global form-encoding in web.xml
o  form-encoding for FileGenerator
o  encoding for HTMLSerializer
o  encoding for XMLSerializer


Snippets:
_______

web.xml
_______


  <servlet>
    ...

    <init-param>
       <param-name>container-encoding</param-name>
       <param-value>ISO-8859-1</param-value>
    </init-param>
    <init-param>
       <param-name>form-encoding</param-name>
       <param-value>UTF-8</param-value>
    </init-param>




_______

sitemap
_______


   <map:generators default="file">
      <map:generator label="content" logger="sitemap.generator.request"
name="request"
                     pool-grow="2" pool-max="16" pool-min="2"
src="org.apache.cocoon.generation.RequestGenerator">
         <form-encoding>UTF-8</form-encoding>
      </map:generator>
   </map:generators>

   <map:serializers default="html">
      <map:serializer logger="sitemap.serializer.xml"
mime-type="text/xml" name="xml"
src="org.apache.cocoon.serialization.XMLSerializer">
         <encoding>UTF-8</encoding>
      </map:serializer>

      <map:serializer logger="sitemap.serializer.html"
mime-type="text/html"
                      name="html" pool-grow="4" pool-max="32"
pool-min="4" src="org.apache.cocoon.serialization.HTMLSerializer">
         <doctype-public>-//W3C//DTD HTML 4.01
Transitional//EN</doctype-public>
 
<doctype-system>http://www.w3.org/TR/html4/loose.dtd</doctype-system>
            <encoding>UTF-8</encoding>
         </map:serializer>
      </map:serializers>

   </map:serializers>





Thanks again and Regards,

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to