Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / January 2006

Tip: Looking for answers? Try searching our database.

URLDecoder

Thread view: 
Frances - 02 Jan 2006 05:07 GMT
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
Paulus de Boska - 02 Jan 2006 10:32 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
, 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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.