title: JavaScript/HTML/Unicode accents: á != á
body: <p>I want to check if a user submitted string is the same as the string in my answer key. Sometimes the words involve Spanish accents (like in sábado), and that makes the condition always false.</p>
  
  <p>I have Firebug log <code>$('#answer').val()</code> and it shows up as <code>sábado</code>. (The <code>á</code> comes from a button that inserts the value <code>&amp;aacute;</code>, if that matters) whereas logging the answer from the answer key shows <code>s&amp;aacute;bado</code> (how I wrote it in the actual answer key).</p>
  
  <p>I have tried replacing the <code>&amp;aacute</code> in the answer key with a normal <code>á</code>, but it still doesn't work, and results in a Unicode diamond-question-mark. When I do that and also replace the value of the button that makes the user-submitted <code>á</code>, the condition works correctly, but then the button, the user string, and the answer string all have the weird Unicode diamond-question-mark.</p>
  
  <p>I have also tried using <code>&amp;#225;</code> in both places and it's no different from using <code>&amp;aacute;</code>. Both my HTML and Javascript are using <code>charset="utf-8"</code>.</p>
  
  <p>How can I fix this?</p>