Since everyone seems to think uri.AbsoluteUri better, but since it fails with relative paths, then there is probably a universal way:
Uri uri = new Uri("fuu/bar.xyz", UriKind.Relative); string notCorruptUri = Uri.EscapeUriString(uri.ToString());
G. Stoynev Mar 14 '13 at 19:01 2013-03-14 19:01
source share