0
I’m populating a list on javascript through a ViewBag
. To ViewBag
has a list of objects and these objects have properties with accented words. They are coming correctly from ViewBag
, but when I add the object to the javascript, they lose their accentuation, leaving only strange characters.
In a word like Verification, it stays Verificação
.
I populate my list as follows:
@foreach(var item in ViewBag.ListRequired)
{
@:var required = {
@:ExamNumber: "@item.ExamNumber",
@:TypeName: "@item.TypeName",
@:Description: "@item.Description"
@:};
@:listRequiredContent.push(required);
}
I tried to put charset="utf-8"
on my tag <script>
but I was unsuccessful.
There are fields on the page that have accentuation and the text is shown correctly. The problem is only when I try to manage the information via javascript.
How can I fix this?