This is example code in ASP.NET MVC 3 Razor:
@section header
{
<script type="text/javascript">
$(function() {
alert('@Resources.ExampleCompany');
});
</script>
}
<div>
<h1>@Resources.ExampleCompany</h1>
</div>
The code above this is just an example, but it also shows my problem with encoding. This variable @Resources.ExampleCompany is a file resources.resx with value ExampleCompany = "Twoja firma / Twój biznes"
In JavaScript, the alert shows the "Twoja firma / Twój biznes
".
Why is character 'ó' 'ó'? What am I doing wrong?
In HTML tag, <h1>@Resources.ExampleCompany</h1>
is displayed correctly.
UPDATE:
Mark Schultheiss wrote a good hint and my "ugly solution" is:
var companySample = "@Resources.ExampleCompany";
$('#temp').append(companySample);
alert($('#temp').text());
Now the character is ó
and looks good, but this is still not answer to my issue.