Skip to content

Instantly share code, notes, and snippets.

@prabirshrestha
Forked from anonymous/url decode
Created September 13, 2011 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prabirshrestha/1214701 to your computer and use it in GitHub Desktop.
Save prabirshrestha/1214701 to your computer and use it in GitHub Desktop.
if elif madness
public static string UrlDecode(string s)
{
#if WINDOWS_PHONE
return System.Net.HttpUtility.UrlDecode(s);
#elif SILVERLIGHT
return System.Windows.Browser.HttpUtility.UrlDecode(s);
#else
// Since HttpUtility.UrlDecode doesn't exist in Client Framework
// get it from Mono.
// Thank god, mono libraries are licensed under MIT.
return UrlDecode(s, Encoding.UTF8);
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment