title: Comparing utf8 encoded string in php
body: <p>I am trying to compare a value submitted as a POST to an internal string. They are both utf8 encoded. This is the code</p>
  
  <pre><code>echo $_POST["province"] . "\n";
  setlocale(LC_COLLATE, "fr_CA");
  echo strcoll($_POST["province"], "Québec");
  </code></pre>
  
  <p>This code echos the following:</p>
  
  <pre><code>Québec
  -38
  </code></pre>
  
  <p>strcoll should return 0 if the string match, not -38. In other words, the comparison fails. How do I compare two utf8 string that are identical to a human reader, but might be encoded differently? I have tried Normalizer:normalize, the common "==" operator, looked at multibyte php extension (but there seem to be no compare functions??) and nothing worked thus far for me.</p>