Link to home
Start Free TrialLog in
Avatar of idek1
idek1

asked on

CGI ENCODER

Greetings,

I am writing a Unix program which submits some data using the HTTP protocol to a remote CGI script...
I am in need of a C function which will encode a given string (so a CGI program can read it), but I am not sure exactly what should be encoded (i.e. I know all spaces become "+" and fields separated by "&", but don't which characters become hex encoded etc.)
Can anyone provide a C function to Encode a given string?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of jconde
jconde

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of idek1
idek1

ASKER

Well yes, however, I suspect that the "." (dot) is not encoded and my question is really about what IS and what is NOT encoded using HTTP. Using your algorithm, the "." would be encoded as hex string, because it is neither a character nor a digit, where it really should not be encoded.

idek1
That depends!!

I have seen browsers that encode everything, and some that don't.

Let me check the algorithms I have (some written by me, some downloaded) and I'll send them to you ok?

--jorge
Avatar of idek1

ASKER


ok... my email is:
irvingd@bigfoot.com

Thanks for your help,
Idek1
As has been said you can encode more than you need.  The ones that need to be encloded are defined in the http protocol specification.