commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xiaowei Jiang <xiao...@stratify.com>
Subject RE: [httpclient] double encoding of %
Date Wed, 17 Jul 2002 23:03:02 GMT
a stupid question: how to add a comment to a bug report?

-----Original Message-----
From: Jeff Dever [mailto:jdever1@nortelnetworks.com]
Sent: Wednesday, July 17, 2002 8:59 AM
To: Jakarta Commons Developers List
Subject: RE: [httpclient] double encoding of %


Xiaowei,

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 [mailto:xiaowei@stratify.com]
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 

        pathSafe.set('%');

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

xiaowei

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


> 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>

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


--
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