title: How to count characters in a unicode string in C
body: <p>Lets say I have a string:</p>
  
  <pre><code>char theString[] = "你们好āa";
  </code></pre>
  
  <p>Given that my encoding is utf-8, this string is 12 bytes long (the three hanzi characters are three bytes each, the latin character with the macron is two bytes, and the 'a' is one byte:</p>
  
  <pre><code>strlen(theString) == 12
  </code></pre>
  
  <p>How can I count the number of characters? How can i do the equivalent of subscripting so that:</p>
  
  <pre><code>theString[3] == "好"
  </code></pre>
  
  <p>How can I slice, and cat such strings?</p>