commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Dever" <>
Subject RE: [httpclient] double encoding of %
Date Wed, 17 Jul 2002 15:58:42 GMT

I agree with your point.  HttpClient already does have the concept of some
characters being "safe" and the rest get encoded.  Please attach your
comments to the bug report so that it will be considered for addition in a
2.0 release milestone.


-----Original Message-----
From: Xiaowei Jiang []
Sent: Tuesday, July 16, 2002 3:05 PM
To: 'Jakarta Commons Developers List'
Subject: RE: [httpclient] double encoding of %

The resolution is pretty simple. In the initialization code for pathSafe in
URIUtil, add the following 


This will make '%' a 'safe' character in path and it won't encode it again.
Just need somebody to check in this change. thanks


-----Original Message-----
From: Kyle R . Burton []
Sent: Tuesday, July 16, 2002 12:02 PM
To: Jakarta Commons Developers List
Subject: Re: [httpclient] double encoding of %

> double encoding of URLs
> 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
> 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
> 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 );


Kyle R. Burton


Wisdom and Compassion are inseparable.
        -- Christmas Humphreys

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message