ASP的Response.Redirect确实不URLEn code" + QUOT;标志 [英] ASP Response.Redirect Does Not URLEncode "+" Sign

查看:300
本文介绍了ASP的Response.Redirect确实不URLEn code" + QUOT;标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IIS 5.0的Response.Redirect之前没有编码,你privide字符串。这是你自己的责任URLEn code中的字符串。

Before IIS 5.0 Response.Redirect was not encoding the string you privide. It was your own responsibility to URLEncode the string.

在IIS 4.0中我们用

On IIS 4.0 we used

Response.Redirect Server.URLEncode("Page,One.asp")

使用IIS 5.0,我们开始只是用

With IIS 5.0 we started just using

Response.Redirect("Page,One.asp")

因此​​,新的Response.Redirect功能URLEn codeS的字符串,没有其他的选择。

So the new Response.Redirect function URLEncodes your string and there is no other option.

有仅仅是一个问题。我不能传递字符串一个+号。
的Response.Redirect(总和= 1 + 3)被执行时,你期望它连接code所有非字母数字字符,但+符号变成在接收页上的空格字符。

There is just one problem. I can not pass a "+" sign in the strings. When Response.Redirect("sum=1+3") is executed, you expect it to encode all the non alphanumeric characters but "+" sign turns into a space character on the receiving page.

的Response.Redirect(总和= 1%2B3)被执行,404未找​​到收到,因为总和%3D1%25B23不存在该服务器上的%2B为en codeD的两倍。

When Response.Redirect("sum=1%2B3") is executed, "404 Not Found" is received because "sum%3D1%25B23" does not exist on the server as %2B is encoded twice.

我想+是连接$ C $光盘作为%2B使得接收页面理解它实际上是一些文本的一部分,并显示它。

I want "+" to be encoded as %2B so that the receiving page understands that it is in fact a part of some text and display it.

我给大家举一个例子:
当您键入
http://translate.google.com/#en|tr|1%2B2
到您的浏览器和pres的输入,你会看到谷歌接受%2B和去codeS其作为一个文本区域+

Let me give you an example: When you type http://translate.google.com/#en|tr|1%2B2 into your browser and pres enter you will see that google accepts %2B and decodes it as a + in the textarea.

无论

的Response.Redirect(http://translate.google.com/#en|tr|1%2B2)

Response.Redirect("http://translate.google.com/#en|tr|1%2B2")

的Response.Redirect(http://translate.google.com/#en|tr|1+2)

Response.Redirect("http://translate.google.com/#en|tr|1+2")

做同样的效果在我给的例子。我只是想重定向到该页面。

does the same effect as in the example i gave. I just want to redirect to that page.

有像第一个编码字符串,然后用的Response.Redirect重定向UNESCAPE(页%2COne%2Easp),但逃脱,UNESCAPE功能支持一些用其它方法UTF-8和ASCII(0-127)的一部分,但不支持高ANSI(128-255)字,尤其是欧洲重音字符。

There is an other way like first encoding the string and then redirecting with Response.Redirect unescape("Page%2COne%2Easp") but escape and unescape functions support some part of UTF-8 and ASCII (0-127) but do not support high ANSI (128-255) characters, notably European accented characters.

有什么建议?

推荐答案

因此,新的Response.Redirect功能URLEn codeS的字符串,没有其他的选择。

你的意思是有没有其他的选择吗?

what do you mean there is no other option ?

server.urlen code仍然存在。

server.urlencode still exists

这篇关于ASP的Response.Redirect确实不URLEn code" + QUOT;标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆