Railo 服务器将加号 (+) 转换为空格
我在 Railo 服务器上注意到了一件奇怪的事情。 当我 cfdump
或 cfoutput
时,我在 url 中传递的所有 +
字符都会自动转换为空格。
是否需要更改服务器设置以使 +
仍为 +
?
Weird thing I noticed on my Railo server.
All +
characters I pass in the url are automatically converted to spaces when I cfdump
or cfoutput
them.
Any server setting to change so that a +
will remain a +
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Railo 不会将
+
字符转换为空格 - 您的浏览器会这样做。(如果您在 ColdFusion 上运行完全相同的代码,您将得到相同的行为。)
在 URL 中,
+
是保留字符,需要编码为%2B
,并且还有其他几个字符也需要编码。您可以使用 CFML 函数 UrlEncodedFormat 对文本进行编码以在 URL 中使用。
Railo is not converting the
+
characters to space - your browser is.(If you run the exact same code on ColdFusion you will get the same behaviour.)
In URLs,
+
is a reserved character and needs to be encoded as%2B
, and there are several other characters that require encoding too.You can use the CFML function UrlEncodedFormat to encode text for use in a URL.