ref: e51c4bc6e493a9cd0d9e9d7f1d24c57ae77bab65
dir: /sys/src/libc/port/utflen.c/
#include <u.h> #include <libc.h> int utflen(char *s) { int c; long n; Rune rune; n = 0; for(;;) { c = *(uchar*)s; if(c < Runeself) { if(c == 0) return n; s++; } else s += chartorune(&rune, s); n++; } }