I have an jQuery autocomplete field with non latin characters.
My Controller has this line:
ViewBag.EstadosDeAlma = (from e in db.EstadosDeAlma select e.Title).ToList();
All results in my database are raw, with no encoding.
In my Razor view I have this line:
var data = '@foreach (dynamic item in ViewBag.EstadosDeAlma){ @(item + " ") }'.split(" ");
As autocomplete function, it works really good, but when I try to search for results with stress as “á” it doesnt work.
When i look to the source code in FireFox, I have this:
var data = 'álacre esperançosa hilária ...
I need to have this source code like this:
var data = 'álacre esperançosa hilária'
Could someone help me with this one?
I had to return results as a string, and not as a list.
When I do this, it works:
Controller:
View: