I want to redirect a request to some URL that may or may not contain non-ascii characters (e.g. german umlauts).
Doing this with the relevant part of the URL:
var url = HttpUtility.UrlEncodeUnicode("öäü.pdf"); // -> "%u00f6%u00e4%u00fc.pdf"
and then issuing the redirect:
Response.Redirect(url, ...);
will not produce the desired behaviour. It appears, the browser (IE, Opera as far as I have tested) doesn't honor this command when the URL to redirect to is Unicode-encoded. Ordinary UrlEncode'd paths work fine.
I have tried setting this in the Web.Config:
<configuration>
<system.web>
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
</system.web>
</configuration>
That didn't change a thing.
Is there anything I can do, to get this to work?