Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

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.UrlEncode()
Decode: System.Web.HttpUtility.UrlDecode()

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
Avatar of AvonWyss
AvonWyss
Flag of Switzerland image

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 Tom Knowlton

ASKER

Awesome....thanks!!!!!!!!

I think I will update my DELETE EML code to use your suggestion....much nicer way to do things!!!!
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.GetEncoding("ISO-8859-1"));
Noted...thanks!