Search code examples
c#silverlightencodingurl-encoding

UrlPathEncode in Silverlight?


I'm trying to encode Unicode characters in a URL in my Silverlight project. I want to use HttpUtility.UrlPathEncode (Source)

However, this version of the HttpUtility class resides in System.Web which is not a Silverlight assembly.

There's a number of HttpUtility classes out there, but I can't find a Silverlight version that allows me to do the specific encoding UrlPathEncode provides.

Is there a Silverlight assembly I am missing that provides this method?


Solution

  • I have not tested it, but maybe the method Uri.EscapeUriString can do what you want. It is available in Silverlight.