You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ph...@mgb.ch on 2002/06/17 11:15:18 UTC

special characters in urls

Hi

I have a question about special characters in urls: 

If I add parameters to urls, I use the 
java.net.URLEncoder.encode to encode the values; 
the javax.servlet.ServletRequest.getParameter-method seems to 
decode such values, but the whole thing seems only to work for the chars

A .. Z
a .. z
0 .. 9 

and a few special ones like blank, -, _ and so. 
Is this right? (this means, I must make sure that no other characters ever
occure in an url ..) 

Thank for any help. 
Philipp

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: special characters in urls

Posted by Ravishankar S <ra...@ionidea.com>.
hi philipp,

here is what the API says..for encode() method

The ASCII characters 'a' through 'z', 'A' through 'Z', and '0' through '9'
remain the same.

The space character ' ' is converted into a plus sign '+'.

All other characters are converted into the 3-character string "%xy", where
xy is the two-digit hexadecimal representation of the lower 8-bits of the
character.

and for decode() mthd of URLDecoder class....

1 and 2 remain the same..

The remaining characters are represented by 3-character strings which begin
with the percent sign, "%xy", where xy is the two-digit hexadecimal
representation of the lower 8-bits of the character.


regs,
ravi

----- Original Message -----
From: <Ph...@mgb.ch>
To: <to...@jakarta.apache.org>
Sent: Monday, June 17, 2002 2:45 PM
Subject: special characters in urls


> Hi
>
> I have a question about special characters in urls:
>
> If I add parameters to urls, I use the
> java.net.URLEncoder.encode to encode the values;
> the javax.servlet.ServletRequest.getParameter-method seems to
> decode such values, but the whole thing seems only to work for the chars
>
> A .. Z
> a .. z
> 0 .. 9
>
> and a few special ones like blank, -, _ and so.
> Is this right? (this means, I must make sure that no other characters ever
> occure in an url ..)
>
> Thank for any help.
> Philipp
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>