I have an action like this:
<%=Html.ActionLink("My_link", "About", "Home", new RouteValueDictionary {
{ "id", "Österreich" } }, null)%>
This produces the following link: http://localhost:1855/Home/About/%C3%96sterreich
I want a link which looks like this - localhost:1855/Home/About/Österreich
I have tried.
Server.HtmlDecode("Österreich")
HttpUtility.UrlDecode("Österreich")
Neither seems to be helping. What else can I try to get my desired result?
I think this is an issue with your browser (IE).
Your code is correct as it is, no explicit UrlEncoding needed.
<%=Html.ActionLink("My_link", "About", "Home", new RouteValueDictionary {
{ "id", "Österreich" } }, null)%>
There is nothing wrong with ASP.NET MVC. See unicode urls on the web, e.g. http://he.wikipedia.org/wiki/%D7%9B%D7%A9%D7%A8%D7%95%D7%AA in IE and in a browser that handles unicode in URLs correctly.
E.g. chrome displays unicode URLs without any problem. IE does not decode "special" unicode characters in address bar.
This is only a cosmetic issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With