diff --git a/legacy/evas/src/lib/engines/common/evas_encoding.c b/legacy/evas/src/lib/engines/common/evas_encoding.c index 2d2a842921..96a269024b 100644 --- a/legacy/evas/src/lib/engines/common/evas_encoding.c +++ b/legacy/evas/src/lib/engines/common/evas_encoding.c @@ -236,14 +236,11 @@ EAPI int evas_common_encoding_utf8_get_len(const char *buf) { /* returns the number of utf8 characters (not bytes) in the string */ - int index = 0, len = 0; + int i = 0, len = 0; + + while (evas_common_encoding_utf8_get_next(buf, &i)) + len++; - while (buf[index]) - { - if ((buf[index] & 0xc0) != 0x80) - len++; - index++; - } return len; }