I have met this difficulty while decoding a Base64 encoded URL with parameters
eg: http://www.example.com/Movements.aspx?fno=hello&vol=Bits & Pieces
My expected results should be: fno = hello vol = Bits & Pieces
#Encoding:
//JAVASCRIPT
var base64 = $.base64.encode("&fno=hello&vol=Bits & Pieces");
window.location.replace("Movements.aspx?" + base64);
#Decoding c#
string decodedUrl = System.Text.Encoding.ASCII.GetString(Convert.FromBase64String(Request.Url.Query.Replace("?", ""))); // Replace is used to remove the ? part from the query string.
string fileno = HttpUtility.ParseQueryString(decodedUrl).Get("fno");
string vol = HttpUtility.ParseQueryString(decodedUrl).Get("vol");
Actual Result: fno = hello vol = Bits
I have searched stackoverlow and seems I need to add a custom algorithm to parse the decoded string. But as the actual URL is more complicated than shown in this example I taought better asks experts for an alternative solution!
Tks for reading!