Special characters in UTF-8 using RenderBody ()

I am developing a site in ASP.NET MVC6 with Polish letters. They work great when I write them in _Layout.cshtml, but I also use RenderBody () to view the views.

Using Html.DisplayFor (modelItem => item.ID) inside, it displays Polish characters correctly, but when I use simple html and write something, all I see on the website is "?" instead of every polish letter.

In _layout.cshtml I have an ad:

<meta charset="utf-8" />

And in web.config I have:

<?xml version="1.0" encoding="utf-8"?>
+4
source share
2 answers

UTF-8, , .cshtml, :

file- > - > Unicode (UTF-8 ) -Codepage 65001

.

+4

asp.net core aka MVC6, visual studio 2017. , â , ViewBag.Equals( "â" ) .

(.cshtml) ++ ANSI UTF-8.

enter image description here

+2

All Articles