In my C program, I process utf-8 strings with libunistring. I can easily use libunistring to determine the number of characters in a string.