title: PHP word boundary /b regex not working with French
body: <p>I'm trying to match the sentence "ça vous dit quoi" with regex pattern:</p>
  
  <pre><code>$pattern=(\b".$value."\b)
  </code></pre>
  
  <p>The word boundaries work with anything except the French exclusive characters like the ç at the beginning of ça. I can solve the word boundary problem by changing the PHP locale thus:</p>
  
  <pre><code>setlocale(LC_ALL, 'fr_FR');
  </code></pre>
  
  <p>When I do this, it successfully matches the sentence, but all the French characters are then displayed as � so I get:</p>
  
  <pre><code>�a vous dit quoi
  </code></pre>
  
  <p>Kind of annoying. Solve one problem only to create another. I already have the html locale set to:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr" version="XHTML+RDFa 1.0" dir="ltr"&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  </code></pre>
  
  <p>Not sure what else needs to be done to fix this? Surely French should display ok with all the locales set to French...?</p>
  
  <p>EDIT:My server is showing UTF-8 as the default character set for both the local and master value through phpinfo.</p>
  
  <p>EDIT:This question is not similar to the one suggested because the question is not similar at all. The solution may be the same but anyone searching in google for the kind of problem I had would not find that question, but they would find mine. I think people are starting to just mark questions as duplicates just for the sake of it.</p>
  
  <p>This question is also similar to mine in the same way, since the answer is the same:
  <a href="https://stackoverflow.com/questions/1922097/regular-expression-for-french-characters">regular expression for French characters</a>
  But that would make all THREE questions duplicates.</p>