You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steve Bosman <st...@gmail.com> on 2005/04/06 16:27:10 UTC

URL encoding/decoding of UTF-8 characters

I raised this on the struts mailing list and had no joy there, but
since then I've found out that it appears to be a tomcat specific
problem.

The struts 1.1. application I am working on has some frameset stuff
(which I personally hate, but some things you are forced to live
with), occasionally frames within the frameset are set with parameters
in the URL which is output using html:rewrite (normally as the result
of failed actions). If a parameter has UTF-8 characters, e.g.
5-апр-2005 this is encoded as this:

/foo.do?date=5-%D0%B0%D0%BF%D1%80-2005

By the time the date arrives in my ActionForm the value is now
5-апÑ?-2005. I have tried this on weblogic, websphere and oc4j and
it returns the correct string using those servers. This application is
running on tomcat 5.0.28 and what I would like to know is: is this a
struts problem, a tomcat problem or my problem and if so does anyone
have suggestions as to how to fix it?

thanks for any help,

Steve Bosman

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


Re: URL encoding/decoding of UTF-8 characters

Posted by Mark Thomas <ma...@apache.org>.
It is a lack of agreed standard problem. You can force Tomcat to use 
UTF-8 encoding by setting the URIEncoding parameter on the connector.
There are some other parameters that you can set as well. See 
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/http.html

Mark

Steve Bosman wrote:
> I raised this on the struts mailing list and had no joy there, but
> since then I've found out that it appears to be a tomcat specific
> problem.
> 
> The struts 1.1. application I am working on has some frameset stuff
> (which I personally hate, but some things you are forced to live
> with), occasionally frames within the frameset are set with parameters
> in the URL which is output using html:rewrite (normally as the result
> of failed actions). If a parameter has UTF-8 characters, e.g.
> 5-апр-2005 this is encoded as this:
> 
> /foo.do?date=5-%D0%B0%D0%BF%D1%80-2005
> 
> By the time the date arrives in my ActionForm the value is now
> 5-апÑ?-2005. I have tried this on weblogic, websphere and oc4j and
> it returns the correct string using those servers. This application is
> running on tomcat 5.0.28 and what I would like to know is: is this a
> struts problem, a tomcat problem or my problem and if so does anyone
> have suggestions as to how to fix it?
> 
> thanks for any help,
> 
> Steve Bosman
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 


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


AW: URL encoding/decoding of UTF-8 characters

Posted by Michael Südkamp <mi...@docware.de>.
Hi,

We have all our pages UTF-8-encoded so I think what I am talking about:
At least in Tomcat you must UTF-8-decode the request parameters obtained from method getParameter() of interface ServletRequest yourself. Our web-apps runs also at some customer sites with other app servers like JRun or WebSphere where this works too.

Michael


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