commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle R . Burton" <mor...@voicenet.com>
Subject Re: [httpclient] double encoding of %
Date Tue, 16 Jul 2002 19:02:01 GMT
> double encoding of URLs
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6624
> 
> This bug was marked as invalid. But I believe that person doesn't really
> understand the problem. The issue is you have to be able to copy a URL from
> IE's address bar, put it in httpclient and it should just work. However,
> when the path has space in it, IE will show %20 in the address bar and
> httpclient will encode the % again. Please think hard about it before you
> really decide it's invalid. My suggestion is that % should never be escaped.
> If the user really wants a literal %, he can encode it himself.

I don't know what the resolution will be on this, but for the time-being
you could decode the URL before cutting &pasting it into httpclient. 
There is even a URIUtil class that can do the decoding for you:

  import org.apache.commons.httpclient.URIUtil;

  ...

    String encodedUrl = "http://localhost/?this=that%20and+the+other+thing";
    String decodedUrl = URIUtil.decode( encodedUrl );


hth

Kyle R. Burton


-- 

------------------------------------------------------------------------------
Wisdom and Compassion are inseparable.
        -- Christmas Humphreys
mortis@voicenet.com                            http://www.voicenet.com/~mortis
------------------------------------------------------------------------------

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


Mime
View raw message