Bloom.Extensions.EscapeCharsForHttp C# (CSharp) Method

EscapeCharsForHttp() public static method

Escapes a number of characters that need it for our url/http processing.
Note that calls to EscapeCharsForHttp() must be matched by an equal number of subsequent calls to UnescapeCharsForHttp(). (Normally each is called once.)
public static EscapeCharsForHttp ( this fileName ) : string
fileName this
return string
        public static string EscapeCharsForHttp(this string fileName)
        {
            fileName = fileName.Replace("%","%25");

            // BL-117, PH: With the newer xulrunner, javascript code with parenthesis in the URL is not working correctly.
            fileName = fileName.Replace("(", "%28").Replace(")", "%29");

            return fileName.Replace(":", "%3A").Replace("#","%23").Replace("?","%3F");
        }