cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barbara Slupik <barbara_slu...@wro.vectranet.pl>
Subject Re: form encoding issues
Date Wed, 29 Sep 2010 21:25:06 GMT
Hello

I followed the instruction here http://cocoon.apache.org/2.2/1366_1_1.html 
. For cocoon-2.1.11 I set

     <init-param>
       <param-name>container-encoding</param-name>
       <param-value>UTF-8</param-value>
     </init-param>

     <init-param>
       <param-name>form-encoding</param-name>
       <param-value>UTF-8</param-value>
     </init-param>

in my web.xml instead of org.apache.cocoon.containerencoding=utf-8 and  
org.apache.cocoon.formencoding=utf-8. I had to create  
SetCharacterEncodingFilter as well. All works fine in utf-8.

Barbara

> Hi,
>
> I'm stumbling on a character encoding issue (cocoon-2.1.10) and  
> really can't see why. Apparently, text input in a form is passed on  
> in a wrong encoding. I've set Cocoon's default encoding in all  
> thinkable places as UTF-8:
>
> web.xml:
> ========
> <servlet>
> <servlet-name>Cocoon</servlet-name>
> <!-- .. -->
> <init-param>
> <param-name>container-encoding</param-name>
> <param-value>UTF-8</param-value>
> </init-param>
> <init-param>
> <param-name>form-encoding</param-name>
> <param-value>UTF-8</param-value>
> </init-param>
> <!-- ... -->
> </servlet>
>
> sitemap.xmap
> ============
> <map:serializer logger="sitemap.serializer.xhtml" mime-type="text/ 
> html" name="xhtml"
>                pool-max="${xhtml-serializer.pool-max}"  
> src="org.apache.cocoon.serialization.XMLSerializer">
> <doctype-public>-//W3C//DTD XHTML 1.0 Transitional//EN</doctype- 
> public>
> <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd 
> </doctype-system>
> <encoding>UTF-8</encoding>
> </map:serializer>
>
> Yet, when I execute following pipeline:
>
> <map:match pattern="test">
> <map:generate src="test.xml"/>
> <map:transform src="test.xsl">
> <map:parameter name="use-request-parameters" value="true"/>
> </map:transform>
> <map:serialize type="xhtml"/>
> </map:match>
>
> ...with following minimal source files:
>
> test.xml
> =======
> <?xml version="1.0" encoding="UTF-8"?>
> <test/>
>
> test.xsl (which will mainly echo the previous input)
> ======
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
> version="2.0">
> <xsl:param name="input"/>
> <xsl:template match="/">
> <html>
> <head>
> <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
> </head>
> <body>
> <form action="test" accept-charset="UTF-8" method="get">
> <input type="text" value="{$input}" name="input"/>
> <input type="submit"/>
> </form>
> <p>current input: <xsl:value-of select="$input"/></p>
> </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
>
> Yet, entering a string with accented characters, like e.g. 'très  
> annoying', this comes out as: 'très annoying'...
> On the other hand, when entering the according URL (<http://localhost:8888/test?input=tr%C3%A8s+annoying

> >) directly, the characters are passed on correctly. Does anyone  
> know how this can be fixed?
>
> Any hints much appreciated!
>
> Ron Van den Branden
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


Mime
View raw message