title: PHP string functions: which ones will work with UTF-8?
body: <p>In the <a href="http://php.net/manual/en/ref.strings.php" rel="nofollow noreferrer">PHP documentation</a> string functions are listed that work on byte level. This works for SBCS strings, but not for MBCS strings. Luckily one famous encoding UTF-8 is backward compatible up to 7 bit US-ASCII.</p>
  
  <p>Since PHP 5.6 the default encoding has changed to UTF-8, but it's string functions have not. The well known alternatives are <a href="http://php.net/manual/en/ref.iconv.php" rel="nofollow noreferrer">iconv</a>, <a href="http://php.net/manual/en/book.mbstring.php" rel="nofollow noreferrer">Multibyte String</a> and <a href="http://php.net/manual/en/book.intl.php" rel="nofollow noreferrer">Intl</a>. Also PCRE functions can be MBCS compliant when compiled in the right way.</p>
  
  <p>When SBCS code of age needs to be transformed to VMBCS (UTF-8) compliance, the standard PHP byte string functions needs to be rewritten to be MBCS safe. Although the most basic functions (like <code>strpos()</code>) have an <code>mb_*</code> variant (like <code>mb_strpos()</code>) most of PHP's string functions have no <code>mb_</code> counterpart. For continued use they have to be rewritten.</p>
  
  <p>In the first stage, one needs to determine which SBCS string functions will work despite their byte oriented nature. Some have been identified already on SO, what I'm looking for now is a comprehensive list of functions that will work with UTF-8, or when used with caution, for example parameters with US-ASCII only. To clarify, the question is not about the byte string functions like <code>chr()</code> or <code>crc32()</code>, it's about getting a list of functions like:</p>
  
  <ul>
  <li>Not safe: <code>count_chars()</code> counts bytes, ...</li>
  <li>Caution: <code>ltrim()</code> will work as long as parameters are US-ASCII, ...</li>
  <li>Safe: <code>str_repeat()</code> will work with MBCS strings, ...</li>
  </ul>
  
  <p>Would anybody know such a list? </p>