I'm using TinyMCE for text editing on my site. When I search for a word with an accent. Eg: análise
, the query does not count because the bank is saved in HTML análise
. I'm using ASP.Net MVC with SQL Server.
I'm using TinyMCE for text editing on my site. When I search for a word with an accent. Eg: análise
, the query does not count because the bank is saved in HTML análise
. I'm using ASP.Net MVC with SQL Server.
There's not much information but basically what you need to do is treat HTML as a special form. You must decide whether to convert the HTML to a common text before you write it to the database or convert your search term to HTML encoding. You need to decide whether you want to write as HTML yourself or if the recording is in poor shape for you and you need to leave it in plain text.
Depending on what you need this will not solve everything but this is the basics you should do.
Utility methods to do this: WebUtility.HtmlEncode
and WebUtility.HtmlDecode
.
Following your code should look something like this:
listaNoticia = context.GBV_Noticia.Where(x => x.idPessoa == idPessoa &&
x.dsConteudo.Contains(WebUtility.HtmlEncode(texto)) && x.icAtivo == "S" &&
x.dtExclusao == null && x.dtPublicacao <= DateTime.Now &&
(x.dtForaDoAr == null || x.dtForaDoAr >= DateTime.Now))
.OrderBy(x =>x.dtPublicacao).ToList();