Is there a way to set the encoding using web.config in asp.net?

Recently, I came across a situation where, using a two-byte language, I had to enter the encoding as a meta tag.

I used to think that the globalization tag in web.config would handle the page encoding, but that doesn't seem to be the case.

Is there a way to set the encoding in the web.config file or set the encoding of the entire website without having to enter a meta tag on each page?

+3
source share
1 answer

Does responseEncoding set in globalization element in web.config file, work?

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

Otherwise, use the base page and set the encoding there, but that works a lot.

+6
source

Source: https://habr.com/ru/post/1714110/


All Articles