you first have to get the right UTF8 string length.
try the function below.
int getUTF8Count(const char * UTF8String)
{
int lastStrPoint = 0;
int len = strlen(UTF8String);
int count = 0;
while (len>lastStrPoint) {
int nLen = 1;
int lastlen = len - lastStrPoint;
while(lastlen>1&&0x80 == (0xC0 & UTF8String[lastStrPoint+nLen]))
{ nLen;
if {
break;
}
}
lastStrPoint= nLen;
count+;
}
return count;
}
you first have to get the right UTF8 string length.
try the function below.
>
int getUTF8Count(const char * UTF8String)
{
int lastStrPoint = 0;
int len = strlen(UTF8String);
int count = 0;
while (len>lastStrPoint) {
int nLen = 1;
int lastlen = len - lastStrPoint;
while(lastlen>1&&0x80 == (0xC0 & UTF8String[lastStrPoint+nLen]))
{ nLen;
if {
break;
}
}
lastStrPoint= nLen;
count+;
}
return count;
}