I'm having some problems with asp.net MVC 4 encoding, where some characters, such as an apostrophe, appear as "

I basically took the html file that someone made and made a new MVC application and put it in the view, but now I am having problems with apostrophes and other characters similar to "he’s a cat".

I compare the opening of the source html file on disk in a browser and the launch of the MVC application which is in my local IIS. The same browser.

The HTML in the section <head>is the same in both cases when viewing the source:

<!DOCTYPE html>
<html class="no-js">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Cats</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="stylesheet" href="css/style.min.css">
    </head>

I am at a loss. Any ideas?

Edit: in firefox, go to View> Encoding shows that both pages are in UTF-8.

+3
source share
2

, , MVC HTML. web.config :

<globalization
      fileEncoding="utf-8"
      requestEncoding="utf-8"
      responseEncoding="utf-8"
      culture="en-US"
      uiCulture="en-US"
    />

<system.web>

+4

, , ISO-8859-1, UTF-8. ISO-8859-1, . HTML- &rsquo; , , UTF-8.

+3

All Articles