title: Is it safe to use `strstr` to search for multibyte UTF-8 characters in a string?
body: <p>Following my previous question: <a href="https://stackoverflow.com/q/25566356/3194340">Why `strchr` seems to work with multibyte characters, despite man page disclaimer?</a>, I figured out that <code>strchr</code> was a bad choice.</p>
  
  <p>Instead I am thinking about using <code>strstr</code> to look for a single character (multi-byte not <code>char</code>):</p>
  
  <pre><code>const char str[] = "This string contains é which is a multi-byte character";
  char * pos = strstr(str, "é"); // 'é' = 0xC3A9: 2 bytes 
  printf("%s\n", pos);
  </code></pre>
  
  <p>Ouput:</p>
  
  <blockquote>
    <p>é which is a multi-byte character</p>
  </blockquote>
  
  <p>Which is what I expect: the position of the 1st byte of my multi-byte character.</p>
  
  <p>A priori, this is not the canonical use of <code>strstr</code> but it seems to work well.<br>
  Is this workaround safe ? Can you think about any side-effect or special case that would cause a bug ?</p>
  
  <p><strong>[EDIT]:</strong> I should precise that I do not want to use <code>wchar_t</code> type and that strings I handle are UTF-8 encoded (I am aware this <a href="http://utf8everywhere.org/" rel="nofollow noreferrer">choice</a> can be discussed but this an irrelevant debate)</p>