I'm working on a system that uses UTF-8 characters in folder names for URLs. There's been no problem in navigating to these URLs and everything works as expected - except when issuing a redirect to another page on the site; whereupon the browser seems to encode the extended characters.
To give an example, I'm attempting to redirect to the following relative URL:
/geschäft/käfer/
If I visit that URL directly in the address bar, there's no problem. However if I change the location header to redirect the browser to this URL, it ends up at:
/gesch%E4ft/k%E4fer/
If I look in the response headers for the original page (It's a 301 redirect to the translated content) I can see this entry:
Location:/geschäft/käfer/
It seems the correct details are ending up in the header, but the browser's address bar is showing the encoded value with %E4 detailed above. I have attempted various ways of entering the URL into the location header, but all come out with the same result.
I am seeing this behaviour on Chrome 37.0.2062.120 m and on Firefox 32.0.2.
This is running on a dev box, Windows 7 Home with IIS7.5
EDIT:
It seems this issue could be related directly to ColdFusion. If I use Javascript to redirect to the url, this works... with the caveat that the file has to be saved with a BOM.
If I use cflocation
, or if I use the pagecontext to insert the header manually, the issue persists regardless of whether or not a BOM is present.
I've also noticed a similar problem with using cfinclude
in that these extended characters are displayed incorrectly unless the calling template is saved with a BOM.