You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sven Köhler <sk...@upb.de> on 2006/02/22 11:52:34 UTC

setCharacterEncoding() für POST-data in JSP

Hi,

<%@page contentType="text/html; charset=UTF8"%>
<%
	request.setCharacterEncoding("UTF-8");
%>
<html>
<body>
<form method="POST">
<input type="text" name="text">
<input type="submit">
</form>
Test: <%=request.getParameter("text")%>
</body>
</html>

The above JSP-page will not work properly. The POST-data is decoded with
ISO-8859-1 instead of UTF-8 in Tomcat 5.5.

Is this a bug or a feature?

If it's a bug - well - then a fix would be nice.

If it's a feature - well - what's the reason for this?


Thanks
  Sven


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


Re: setCharacterEncoding() für POST-data in JSP

Posted by Sven Köhler <sk...@upb.de>.
> But there is something i should first look at before i further complain:
> some ServletFilters. Maybe one called getParameter() which could be the
> cause.

Yes, one of the servletfilters calls getParameter() on the request.

Sorry for taking your time.


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


Re: setCharacterEncoding() für POST-data in JSP

Posted by Sven Köhler <sk...@upb.de>.
>> The above JSP-page will not work properly. The POST-data is decoded with
>> ISO-8859-1 instead of UTF-8 in Tomcat 5.5.
> Works for me using the latest 5.5 from svn.

interesting! (and at least, there's some hope for me :-) )

> It would be a bug but since it is working for me it looks like a
> configuration issue on your system.

i will try to look at it.

> What Tomcat version? I haven't checked the releaes notes but there may
> have been an issue with an earlier version.

5.5.15

> Is the browser displaying the page as UTF-8?

yes

> Are you using the RequestDumperValve? This ignores any encoding and
> forces ISO-8859-1 to be used for all parameters.

afaik: no


But there is something i should first look at before i further complain:
some ServletFilters. Maybe one called getParameter() which could be the
cause.


Greetings
  Sven


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


Re: setCharacterEncoding() für POST-data in JSP

Posted by Mark Thomas <ma...@apache.org>.
Sven Köhler wrote:
> The above JSP-page will not work properly. The POST-data is decoded with
> ISO-8859-1 instead of UTF-8 in Tomcat 5.5.
Works for me using the latest 5.5 from svn.

It would be a bug but since it is working for me it looks like a
configuration issue on your system.

What Tomcat version? I haven't checked the releaes notes but there may
have been an issue with an earlier version.

Is the browser displaying the page as UTF-8?

Are you using the RequestDumperValve? This ignores any encoding and
forces ISO-8859-1 to be used for all parameters.

Mark


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