On Mon, 2009-01-12 at 11:52 +0000, Paul Taylor wrote:
> Peter Voss wrote:
> > Hi Bill,
> >
> > you could use java.net.URLDecoder. First extract the part of your
> > string that has to be decoded. Then call:
> > URLDecoder.decode(encodedString, "UTF-8");
> >
> > e.g.
> > URLDecoder.decode("http%3A%2F%2Fwww.google.com%2F", "UTF-8")
> > will return
> > http://www.google.com/
> >
> Im not sure this is right because URLencoder/Decoder is for form url
> encoding which is slighty different
>
> I think you should the uri class instead
>
> URI uri = new URI("http",
> "localhost",proxy/http%3A%2F%2Fwww.google.com%2F ,null);
> return uri.toString();
>
> this allows you to pass the whole string , you dont need to extract
> parts of the String. Note the 4th null parameter, you need this if you
> use the 3 parameter constrcutor it wont work
>
>
> Paul
>
You might also want to take a look at Commons Codec.
http://commons.apache.org/
Oleg
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]