Reputation: 44620
I have model with validation by data annotations:
public class MyModel
{
[Required(ErrorMessage = "Введите название")] //cyrillic (cap)
public string Name { get; set; }
}
When I see this validation message in browser, it looks like that:
Îòïðàâë ïîâòîðíî
I have <meta http-equiv="content-type" content="text/html; charset=utf-8" />
in head.
How can I fix that?
Upvotes: 0
Views: 1203
Reputation: 13
Andrei, I had the same problem. But your solution didn't work for me. I managed it only by saving cs-file in UTF-8
. In earlier version of VS I had no problem with ErrorMessages in russian language.
Upvotes: 1
Reputation: 44620
Accidently I found how to fix it:
Project properties -> Application -> Assembly Information -> Neutral language
Upvotes: -1
Reputation: 1039160
Make sure that your Razor templates (.cshtml/.vbhtml) files are UTF-8 encoded: in Visual Studio open your _Layout.cshtml and select File -> Save As and then Save with Encoding...
Then select Unicode (UTF-8 with signature):
Do the same for all your Razor templates and views.
Also if you are using HTML 5 you might use the shorter version of the meta tag:
<meta charset="utf-8">
Upvotes: 2