I have a .NET MVC page with a list of elements, each of which has <%: %> encoded descriptions in rel . I want to be able to search all elements with rel , which contains my search query.
One of the fields matters with htmlentities rel='Décoration'
I find "Décoration" in the search box, let jQuery look for all elements that have the rel attribute that contains the (indexOf! = -1) value:
No results!
Why? because Décoration != Décoration .
What would be the best solution to compare the two? (Should work for all special characters with an accent, not just é )
PS (I tried escape / unescape on both sides, also tried the trick to add it to the div and then read it as text, this replaces the dangerous stuff, but does not replace é (it isn’t because it is valid in utf -8 in anyway))
Michiel cornille
source share