I have a querystring value which don't convert to right encoding?
I pass actually Göte in the querystring paramete开发者_如何学编程r, which converts to G%F6te in the url field. And in the page, actually a generic handler it displays:
G�te
How to fix it, so it displays Göte?
--------- EDIT ----------------
It actually works fine when I make a ajax-call to the page, but when I directly alter the querystring parameter it doesn't.
Make use of : HttpServerUtility.UrlEncode Method
Encoding:
String MyURL;
MyURL = "http://www.contoso.com/articles.aspx?title=" + Server.UrlEncode("ASP.NET Examples");
Response.Write("<a href=" + MyURL + "> ASP.NET Examples </a>");
Decoding:
decodedUrl = Server.UrlDecode(urlToDecode)
精彩评论