On 08.07.2008 08:26, Gautam Joshi (jgautam) wrote:

We are trying to set character encoding to UTF-8 in the request object
(org.apache.catalina.connector.RequestFacade) to ensure that the Danish
and some other characters are
processed correctly. We observed however that just using request.setCharacterEncoding(
encoding ) does not work and the Danish characters are converted to
question marks.
However when you add the line Enumeration e =
request.getParameterNames() before request.getParameterNames() the
encoding works and the original characters submitted from the form are retained. The request object is an instance of org.apache.catalina.connector.RequestFacade. Has anyone come accross this problem and does anyone know why accessing
the method request.getParameterNames enables the character encoding to
work appropriately?

That's how it works. You MUST set character encoding BEFORE accessing request parameters. IIRC that's what form-encoding parameter is therefore with which Cocoon ensures that. See Cocoon's web.xml.

Joerg


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

Reply via email to