Tom Knowlton
asked on
Expert AvonWyss: Question on Encode / Decode URL
Avon:
You wrote in another post:
========================== =======
Very easy:
Add a reference to the System.Web assembly.
Encode: System.Web.HttpUtility.Url Encode()
Decode: System.Web.HttpUtility.Url Decode()
Note that the functions provided by the other expers will fail in situations where other special chars are contained, like all chars with accents (öäüéàè etc.), but even " " is missing (%20). The method given here also allows you to specify an encoding if necessary.
========================== =======
Plesae provide complete working functions that demonstrate the use of the above methods!!!!!
Thanks,
Tom
You wrote in another post:
==========================
Very easy:
Add a reference to the System.Web assembly.
Encode: System.Web.HttpUtility.Url
Decode: System.Web.HttpUtility.Url
Note that the functions provided by the other expers will fail in situations where other special chars are contained, like all chars with accents (öäüéàè etc.), but even " " is missing (%20). The method given here also allows you to specify an encoding if necessary.
==========================
Plesae provide complete working functions that demonstrate the use of the above methods!!!!!
Thanks,
Tom
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome. Actually, they are not only nicer, but also make sure that everything is escaped.
Just a note, if you use this againstg webservers which don't use UTF8 (Exchange DOES support this, so this does NOT matter for your WebDAV stuff), you can specify an encoding: output=UrlEncode(input, System.Text.Encoding.GetEn coding("IS O-8859-1") );
Just a note, if you use this againstg webservers which don't use UTF8 (Exchange DOES support this, so this does NOT matter for your WebDAV stuff), you can specify an encoding: output=UrlEncode(input, System.Text.Encoding.GetEn
ASKER
Noted...thanks!
ASKER
I think I will update my DELETE EML code to use your suggestion....much nicer way to do things!!!!