I have an issue that´s giving me many problems. I need to set from an cshtml using C# code some variables to javascript. The problem is that accutes and the spanish "ñ" are showed like unicode strings in the window.
I´m trying this code:
@:var nombrePersona = '@System.Text.Encoding.Unicode.GetString(System.Text.Encoding.Unicode.GetBytes(participante.Nombre))'
@:var apellidoPersona = '@System.Text.Encoding.Unicode.GetString(System.Text.Encoding.Unicode.GetBytes(participante.Apellidos))'
And the result in javascript is like:
"Jes'&'#250;s" and it should be "Jesús"
Any idea of how to fix this?
Thank you