I have two similar controllers in ASP.NET MVC and ASP.NET Core 6 projects that both run through IIS. When I request the first one, the custom http request header containing unicode characters is parsed correctly:
When I request the second one, instead of unicode characters, I get question marks (65533-symbol):
How can I get the same result in the second case as in the first?
CodePudding user response:
UPDATE
After consulting the official documentation, I regret to tell you that adding Bulgarian to the Http Header directly is not supported. (I googled it and found that it might be Bulgarian language)
Please use System.Web.HttpUtility.UrlEncode
method to encode the characters.
var desc22=HttpContext.Request.Headers["Description"];
string desc22_ncode1 = System.Web.HttpUtility.UrlEncode(text, System.Text.Encoding.UTF8);
return ...
Related Post
1. File format name downloads in foreign language not supported on Azure