You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Nacho <na...@siapi.es> on 2000/07/18 00:54:00 UTC

Win2K x-www-form-urlencoded problem

Hola a Todos:

I'm trying to get tomcat to serve files with spaces in the name as
"Copia de Test.html"  this is the easy part, i only need to do one
URLDecode.decode() somewhere, but the strange part comes with accents in
Win2k, it permits to have file names like "Diputación_1Página2.html"
that inside Tomcat are "Diputaci%C3%B3n_1P%C3%A1gina2.html" as you see
accents are converted to a UTF-8 form of x-www-form-urlencoded (MS
propietary?), and when i use URLDecoder.decode() the string i get is
"Diputación_1Página2.html" that is bad.

How can i Decode this? is there any way or class that do it, or i need
to do it on my own?.. 

Saludos ,
Ignacio J. Ortega

Re: Win2K x-www-form-urlencoded problem

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Nacho wrote:

> Hola a Todos:
>
> I'm trying to get tomcat to serve files with spaces in the name as
> "Copia de Test.html"  this is the easy part, i only need to do one
> URLDecode.decode() somewhere, but the strange part comes with accents in
> Win2k, it permits to have file names like "Diputación_1Página2.html"
> that inside Tomcat are "Diputaci%C3%B3n_1P%C3%A1gina2.html" as you see
> accents are converted to a UTF-8 form of x-www-form-urlencoded (MS
> propietary?), and when i use URLDecoder.decode() the string i get is
> "Diputación_1Página2.html" that is bad.
>
> How can i Decode this? is there any way or class that do it, or i need
> to do it on my own?..
>

Funny that you should be looking a this -- I'm just in the midst of patching
HttpRequestAdapter to use the URL decoder in the
org.apache.tomcat.util.RequestUtil package.  (URLDecoder is Java2 specific,
so you won't be able to use it for Tomcat 3.2).

Why don't you let me test and commit the patch (main branch only until we're
satisfied), and you can see if it fixes your problem.

>
> Saludos ,
> Ignacio J. Ortega
>

Craig


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