hello.. happy new year to all... can some pls explain what exactly
URLDecoder does? it converts to a string, yes, but WHAT exactly? it
says in docs:
class contains a utility method for converting from a MIME format called
"x-www-form-urlencoded" to a String
pls what it meant exactly by "a MIME format called
'x-www-form-urlencoded'"? thank you...
Frances
a URL may only consist of letters, digits and these symbols :
- ; & ? % + = (and then some ...)
All other symbols have to be encoded, so this would be a valid URL :
http://blip.blop.org?fname=Jane%20Bond
, where %20 stands for a space.
So decode decodes such a string to a string containing the proper
symbols and encode, btw, does the opposite.
URL syntax:
http://www.gbiv.com/protocols/uri/rfc/rfc3986.html
---
Paul Hamaker, SEMM
http://javalessons.com
Frances - 02 Jan 2006 16:57 GMT
> a URL may only consist of letters, digits and these symbols :
> - ; & ? % + = (and then some ...)
[quoted text clipped - 8 lines]
> Paul Hamaker, SEMM
> http://javalessons.com
ok, but don't all valid urls already include right symbols? (otherwise
they're not urls..) I mean if you have a url that contains symbols that
are not ok (for example"$", what is this "$" encoded TO?)
can u give me an example of a "x-www-form-urlencoded" string? still
very confused about this.. would like to see examples of:
a string Decoded, what it looks like before and after
a string Encoded, what it looks like before and after..
thanks.. Frances
Frances - 02 Jan 2006 17:39 GMT
>> a URL may only consist of letters, digits and these symbols :
>> - ; & ? % + = (and then some ...)
[quoted text clipped - 20 lines]
>
> thanks.. Frances
I just took following query string:
Fname=meme&Lname=hello&email=me@me.com&phone=212-909-9295&software=Photoshop&software=PowerPoint&OperSys=Windows
2000&colors=blue&fruit=orange&message=aaaa$#$^$%%^ER#$#%#$
decoded it (URLDecoder.decode(QueryString, "UTF-8")
and got exact same string back:
Fname=meme&Lname=hello&email=me@me.com&phone=212-909-9295&software=Photoshop&software=PowerPoint&OperSys=Windows
2000&colors=blue&fruit=orange&message=aaaa$#$^$%%^ER#$#%#$
I really don't get this...
thanks again.. Frances
Roedy Green - 03 Jan 2006 00:40 GMT
>Fname=meme&Lname=hello&email=me@me.com&phone=212-909-9295&software=Photoshop&software=PowerPoint&OperSys=Windows
>2000&colors=blue&fruit=orange&message=aaaa$#$^$%%^ER#$#%#$
>
>I really don't get this..
put some "awkward" characters in your string like space.
See http://mindprod.com/jgloss/urlencoded.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Roedy Green - 03 Jan 2006 00:39 GMT
>a URL may only consist of letters, digits and these symbols :
>- ; & ? % + = (and then some ...)
>All other symbols have to be encoded, so this would be a valid URL :
>http://blip.blop.org?fname=Jane%20Bond
see http://mindprod.com/jgloss/urlencoded.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.