feat(utf-8 string): implemented get size function
This commit is contained in:
parent
8b3be3d1cb
commit
016bc759f3
2 changed files with 10 additions and 0 deletions
|
|
@ -56,3 +56,4 @@ FledastyUtf8String fledasty_utf8_string_encode(const uint32_t *unicode, const si
|
|||
uint32_t *fledasty_utf8_string_decode(const FledastyUtf8String *current_string, size_t *unicode_string_size);
|
||||
|
||||
bool fledasty_utf8_string_validate(unsigned char *character_string, const size_t character_string_size);
|
||||
size_t fledasty_utf8_string_get_size(unsigned char *character_string);
|
||||
|
|
@ -434,3 +434,12 @@ bool fledasty_utf8_string_validate(unsigned char *character_string, const size_t
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t fledasty_utf8_string_get_size(unsigned char *character_string) {
|
||||
size_t size = 0;
|
||||
while (character_string[size] != '\0') {
|
||||
size += 1;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue