I want to compare two strings in JavaScript that are the same, and yet the equality operator ==
returns false. One string contains a special character (eg. the
I had this same problem.
Adding
to the HTML file fixed the issue.
In my case the templating engine was baking a json string into the HTML file. This string was in unicode.
While the template was also a unicode file, the JS engine was treating the string I wrote into the template as a latin-1 encoded string, until I added the meta tag.
I was comparing the typed in string to one of the JSON objects items (location.title == "Mühle"
)