Accents in the MVC5 controller parameter

I have a controller that looks like

public ActionResult Search(string firstname, string lastname)
{
    ...
    return View();
}

      

When do I contact / Search? firstname = HervΓ©, the value I get for the first name in my controller is Herv

Is there a way to make my emphasis on the controllers?

+3


source to share


1 answer


I put charset

headers not set:

Content-Type: text/html; charset=utf-8

      

This header must be set when sending a request from a client. Also don't forget to enable the settings globalization

in the Web.config.



<configuration>
   <system.web>
      <globalization
           fileEncoding="utf-8"
           requestEncoding="utf-8"
           responseEncoding="utf-8"
           culture="en-US"
           uiCulture="de-DE"
        />
   </system.web>
</configuration>

      

https://msdn.microsoft.com/en-us/library/ydkak5b9%28v=vs.71%29.aspx?f=255&MSPPError=-2147217396

+3


source







All Articles