|
|
@@ -280,46 +280,3 @@ int cucul_utf32_is_fullwidth(unsigned long int ch) |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
* XXX: The following functions are local. |
|
|
|
*/ |
|
|
|
|
|
|
|
unsigned int _cucul_strlen_utf8(char const *s) |
|
|
|
{ |
|
|
|
int len = 0; |
|
|
|
char const *parser = s; |
|
|
|
|
|
|
|
while(*parser) |
|
|
|
{ |
|
|
|
int i; |
|
|
|
int bytes = 1 + trailing[(int)(unsigned char)*parser]; |
|
|
|
|
|
|
|
for(i = 1; i < bytes; i++) |
|
|
|
if(!parser[i]) |
|
|
|
return len; |
|
|
|
parser += bytes; |
|
|
|
len++; |
|
|
|
} |
|
|
|
|
|
|
|
return len; |
|
|
|
} |
|
|
|
|
|
|
|
char const *_cucul_skip_utf8(char const *s, unsigned int x) |
|
|
|
{ |
|
|
|
char const *parser = s; |
|
|
|
|
|
|
|
while(x) |
|
|
|
{ |
|
|
|
int i; |
|
|
|
int bytes = 1 + trailing[(int)(unsigned char)*parser]; |
|
|
|
|
|
|
|
for(i = 1; i < bytes; i++) |
|
|
|
if(!parser[i]) |
|
|
|
return parser; |
|
|
|
parser += bytes; |
|
|
|
x--; |
|
|
|
} |
|
|
|
|
|
|
|
return parser; |
|
|
|
} |
|
|
|
|