且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 ColdFusion 重定向到 UTF-8 URL

更新时间:2023-09-13 19:35:10

我去测试了,没有看到同样的结果.但后来我又玩了一点,并尝试使用

I went to test this and didn't see the same result. But then I played with it a little more and tried using

<cfprocessingdirective pageencoding = "utf-8"/>

立即,我能够看到与您完全相同的问题.将它包含在任何页面中似乎很自然.这是非常推测的,但是当与 pageencoding 指令结合使用时,CFAS 可能会在 cflocation 标记中进行某种 URL 编码.

Immediately, I was able to see the exact same issue that you did. It seems natural to include it in any page. This is very speculative, but CFAS may be doing some kind of URL encoding in the cflocation tag when used in conjunction with the pageencoding directive.

假设您的代码中有此内容,请尝试将其删除以进行重定向.如果可行,那么我会将其作为错误报告给 Adob​​e.

Assuming you have this in your code somewhere, try removing it for the redirect. If that works, then I would report this as a bug to Adobe.

仅供参考,我是这样做的——使用编码输出

Just FYI, I did this -- Output with encoding

<cfprocessingdirective pageencoding = "utf-8"/>
geschäft/käfer/

我得到了

geschäft/käfer/

但是当我这样做时——使用编码重定位

But when I did this -- Relocation with encoding

<cfprocessingdirective pageencoding = "utf-8"/>
<cflocation url="geschäft/käfer/" addtoken="false" />

它把我搬到了

gesch%E4ft/k%E4fer/

当我这样做时——输出不编码

And when I did this --Output without encoding

geschäft/käfer/
<cfabort>

我明白了

geschäft/käfer/

但是当我这样做时——不编码的重定位

But when I did this -- Relocation without encoding

<cflocation url="geschäft/käfer/" addtoken="false" />

然后我被调到

geschäft/käfer/