❔ How to fix encoding in Razor View?

Hello, I want to show error as JS alert
@if (ViewBag.Error != null)
{
    var error = ViewBag.Error as ErrorViewModel;
    <script>
            alert("@error.Message");
    </script>
}

message contains polish characters and I got this as shown on picture.
How to fix encoding to show polish characters correctly.
I have set meta charset as UTF-8
image.png
Was this page helpful?