cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: Encoding Problem: File Upload and UTF-8
Date Mon, 07 Mar 2005 08:34:51 GMT
On Sun, 2005-03-06 at 20:46 +0100, stefan pickschneider wrote:
> Bertrand Delacretaz wrote:
> > Le 5 mars 05, à 15:17, stefan pickschneider a écrit :
> > 
> >> ..we have a problem with the encoding, cforms and file uploads.
> > 
> > 
> > Did you look at http://wiki.apache.org/cocoon/RequestParameterEncoding ?
> > It might give some answers.
> > 
> > -Bertrand
> 
> Hello,
> 
> thanks for your suggestion - it helped me to find a "solution".
> 
> It seems that the cocoon servlet initializes the container-encoding for 
> the request too late, so that the default encoding iso-8859-1 is used 
> for reading the parameters. These are incorrectly decoded, since 
> container-encoding and form-encoding are set to UTF-8 in web.xml.
> All forms etc. are UTF-8, too.
> This problem only happens if you're using "application/x-www-
> form-urlencoded" as enctype. For "multipart/form-data" it works, because
> MultipartHttpServletRequest doesn't try to decode parameters.
> 
> Solution:
> In CocoonServlet.java around line 1040 insert
>          // set encoding before parameters are accessed
>          request.setCharacterEncoding(this.containerEncoding);
> before
> 	// Get the cocoon engine instance
>          getCocoon(request.getPathInfo(), 			
> 	request.getParameter(Constants.RELOAD_PARAM));
> 
> 
> Hope someone needs it and it is not too dirty ;-)
> Stefan.
> 

This problem is already fixed, though in a different way:

http://svn.apache.org/viewcvs.cgi/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java?rev=106200&r1=55730&r2=106200

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message