On Wed, Sep 24, 2003 at 10:10:04AM -0500, David Chevalier wrote: I do a tremendous amount of remote server transmission, with and without palm. If you have a specific question about URL encoding, feel free to email me directly.
If you are encoding information into the end of the URL for a GET operation (e.g. http://www.someplace.com/cgi-bin/myprog?encodedurlinfogoeshere) ...than you have to be careful about the characters used and also the total length (though it's rare to exceed 4096 max bytes for a URL). One thing you might note is that, depending on the web server software your using (e.g., Apache, etc) - that some servers convert some characters to hex, and can also backslash some characters. One way to avoid this is simply to encode all your info into a pure alpha-numeric stream (this also obscures the url info a bit to keep it from being plain-text captured). One of the simplist ways is simply hex encoding (e.g., replace each character in your data with it's ascii-hex code equivalant - so for example, if your data contained a plus sign (+) you would write it as "2B"). While this doubles the size of your URL data it does have the advantage of (1) being quick to encode/decode and (2) being immune to any changes by the web server or users browser (e.g., ALL characters can be transmitted that way). Another option is not to use the URL itself to pass the data, but instead of posting it as a GET, post it as a POST operation and include the data as a 'form' (as if the browser submitted a form). However, that's more involved but does have the advantage of allowing unlimited length of material. hope this helps > narender reddy wrote: > > I have a problem of encoding the text which i am > >sending for the server.Any one has written any code > >how to encode.I appericate if some one help me with > >some piece of code on encoding. > > RFC 2396 is a good place to start learning. > > step 1: escape all chars not in the unreserved set (except spaces) > step 2: replace all spaces with '+' > > Here's an example: > > >$100 100% 2^3 5*4 > >%24100+100%25+2%5E3+5*4 > > > -Dave > > > -- > For information on using the Palm Developer Forums, or to unsubscribe, > please see http://www.palmos.com/dev/support/forums/ -- David Cook -- Cookware Inc. -- [EMAIL PROTECTED] TQworld and tranquility: www.TQworld.com Cookware Corporate: www.cookwareinc.com Hawaii/Asia Office: (808) 966-5049 (david cook) Mainland US Office: (317) 769-5049 (deborah sellers) Have you had tranquility today? Play now at http://www.tqworld.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
