You could try to use HttpServerUtility.UrlEncode instead.
Microsoft documentation on Microsoft.JScript.GlobalObject.escape states that it isn't inteded to be used directly from within your code.
Edit:
As I said in the comments: The two methods encode differently and Request.QueryString expects the encoding used by HttpServerUtility.UrlEncode since it internally uses HttpUtility.UrlDecode.
(HttpServerUtility.UrlEncode actually uses HttpUtility.UrlEncode internally.)
You can easily see the difference between the two methods.
Create a new ASP.NET Web Application, add a reference to Microsoft.JScript then add the following code:
protected void Page_Load(object sender, EventArgs e)
{
var msEncode = Microsoft.JScript.GlobalObject.escape("áíóú");
var httpEncode = Server.UrlEncode("áíóú");
if (Request.QueryString["a"] == null)
{
var url = "/default.aspx?a=" + msEncode + "&b=" + httpEncode;
Response.Redirect(url);
}
else
{
Response.Write(msEncode + "<br />");
Response.Write(httpEncode + "<br /><br />");
Response.Write(Request.QueryString["a"] + "<br />");
Response.Write(Request.QueryString["b"]);
}
}
The result should be:
%E1%ED%F3%FA
%c3%a1%c3%ad%c3%b3%c3%ba
����
áíóú