title: How do I read UTF-8 characters via a pointer?
body: <p>Suppose I have UTF-8 content stored in memory, how do I read the characters using a pointer?  I presume I need to watch for the 8th bit indicating a multi-byte character, but how exactly do I turn the sequence into a valid Unicode character?  Also, is <code>wchar_t</code> the proper type to store a single Unicode character?  </p>
  
  <p>This is what I have in mind:</p>
  
  <pre>
  <code>
     wchar_t readNextChar (char*& p)
     { 
         wchar_t unicodeChar;
         char ch = *p++;
  
         if ((ch & 128) != 0)
         {
             // This is a multi-byte character, what do I do now?
             // char chNext = *p++; 
             // ... but how do I assemble the Unicode character?   
             ...
         }
         ...
         return unicodeChar;
     }  
  </code>
  </pre>